The @generate directive specifies which GraphQL APIs are generated for a given type. Without it, all queries & mutations are generated except subscription.
@generate directive is used to specify which GraphQL APIs are generated
for a given type.
Hereβs the GraphQL definition of the directive
Boolean variables inside
the @generate directive to true. Passing false forbids the generation of
the corresponding APIs.
The default value of the subscription variable is false while the default
value of all other variables is true. Therefore, if no @generate directive
is specified for a type, all queries and mutations except subscription are
generated.
queryPerson query and addPerson,
updatePerson mutations. It wonβt generate getPerson, aggregatePerson
queries nor a deletePerson mutation as these have been marked as false using
the @generate directive. Note that the updatePerson mutation is generated
because the default value of the update variable is true.