I'm trying to mock my schema generated with NestJS, the resolvers are using the @Resolver annotation from @nestjs/graphql
.
I've seen that to mock an schema you need to use addMockFunctionsToSchema
method, so for building it, I'm using the buildSchema
from type-graphql
but I'm getting an Error: Generating schema error
.
Is it because nestjs don't use the same @Resolver
annotation than type-graphql
?
Thanks
Try to console.log
the "Generating schema error" and check the reason in error.originalError
property.
Without resolvers you have no Query
type so the schema won't work with graphql-js
. You might pass the skipCheck
option to the buildSchema
to get only the types.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.