Expose only specific resolvers

Merging @CRUD and @withSubscription directive

Currently, there exists a @withSubscription directive to specify whether to generate subscriptions for types or not. The current discuss post is about having a @CRUD directive to specify whether to generate get, query, add, update and delete APIs for types.

Instead of having two separate directives to generate GraphQL queries of types, we propose having a single @generate directive which will have variables to specify whether to generate subscription queries and also other CRUD operations.

An Example of @generate directive:

type Person @generate(
	query: {
		get: true,
		query: false
	},
	mutation: {
		add: true,
		update: false,
		delete: true
	},
	subscription: true
) {
  id: ID!
  name: String!
}

This will give greater control to Users on what APIs to generate for each type.
The existing @withSubscription directive will be deprecated.

1 Like