graphql-leveler
graphql-leveler copied to clipboard
Enable leveler on the schema level
Thanks for this Peter!
Right now the process of enabling leveler in a graphql schema is a bit involved. It would be great to have a way to enable leveler for all GraphQLObjectType
in a given schema or high level type.
This will be hard in situations where part of the schema is provided externally and the source cannot be modified easily. With the current process you have to be very careful not to forget to use GraphQLObjectType
, if you do there is no way to detect that easily.
It would be great something like:
enableLeveler(schema: GraphQLSchema) {
// Traverse the schema recursively and decorate `GraphQLObjectType` with leveler features.
}
That's a great idea! I could see some cases where you would want to only provide leveler features on specific object types, but in cases where you do want to convert all object types to leveler types this would be very useful.