warning Warning This chapter applies only to the code first approach.
To manually generate a GraphQL SDL schema (i.e., without running an application, connecting to the database, hooking up resolvers, etc.), use the
info Hint The
GraphQLSchemaFactoryare imported from the
printSchemafunction is imported from the
gqlSchemaFactory.create() method takes an array of resolver class references. For example:
It also takes a second optional argument with an array of scalar classes:
Lastly, you can pass an options object:
skipCheck: ignore schema validation; boolean, defaults to
orphanedTypes: list of classes that are not explicitly referenced (not part of the object graph) to be generated. Normally, if a class is declared but isn't otherwise referenced in the graph, it's omitted. The property value is an array of class references.