You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I am dynamically generating resolvers from a schema. These resolvers are then passed as parameters to addMocksToSchema:
const server = new ApolloServer({
schema: addMocksToSchema({
schema: makeExecutableSchema({ typeDefs: typeDefs }),
mocks: mocks,
resolvers: generatedResolvers
}),
});
Internally, these are passed to addResolversToSchema (in graphql-tools/schema), which fails with the error ${typeName}.${fieldName} defined in resolvers, but not in schema. This failure can be avoided by sending resolverValidationOptions = { requireResolversToMatchSchema: 'ignore'/'warn' } to addResolversToSchema.
To achieve this, we need to add the resolverValidationOptions parameter to addMocksToSchema, which will then pass it to addResolversToSchema.
Describe the solution you'd like
Modify the addMocksToSchema definition to accept a resolverValidationOptions parameter.
This parameter will be passed to addResolversToSchema.
Describe alternatives you've considered
Manually filtering out the extra resolvers from the generatedResolvers - very much prone to failure.
Additional context
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I am dynamically generating resolvers from a schema. These resolvers are then passed as parameters to
addMocksToSchema
:Internally, these are passed to
addResolversToSchema
(ingraphql-tools/schema
), which fails with the error${typeName}.${fieldName} defined in resolvers, but not in schema
. This failure can be avoided by sendingresolverValidationOptions = { requireResolversToMatchSchema: 'ignore'/'warn' }
toaddResolversToSchema
.To achieve this, we need to add the
resolverValidationOptions
parameter toaddMocksToSchema
, which will then pass it toaddResolversToSchema
.Describe the solution you'd like
Modify the
addMocksToSchema
definition to accept aresolverValidationOptions
parameter.This parameter will be passed to
addResolversToSchema
.Describe alternatives you've considered
Manually filtering out the extra resolvers from the generatedResolvers - very much prone to failure.
Additional context
The text was updated successfully, but these errors were encountered: