Closed Edsol closed 4 months ago
Is it necessary though? You could already disable mutations (or, any query at all) by using custom schema with reused types\resolvers. Is it that much more convenient to pass a flag instead?
rather than starting with manual schema construction, I am trying to create an automatic generator from an existing database (see here).
I did something like this to generate a mutationless schema:
const noMutationsSchema = new GraphQLSchema({
query: schema.getQueryType(),
subscription: schema.getSubscriptionType(),
});
it seems unnecessary to me to generate a new scheme, I have not found a faster alternative solution.
I see, that's more convenient it seems. I'll be adding ability do enable\disable queries (UPD: that crashes schema, will stick to mutations only) to that as well, thanks for your contribution.
Added configuration to
buildSchema
to disable creation of mutations