Minimum reproduction repository for GraphQL ObjectTypes not being registered if they are not included in a query or mutation
Steps taken:
- Globally install the Nest CLI (v10.1.10)
- Create a new Nest project:
nest new - Add the GraphQL packages:
npm i @nestjs/graphql @nestjs/apollo @apollo/server graphql - Import the
GraphQLModulein theAppModule - Create a healthcheck resolver (there must be at least one query)
- Create the
FooObjectType and aFooResolverresolver - Run the app to generate the schema
- Observe that the schema does not include the
Footype