ariadne
ariadne copied to clipboard
Validate that root resolvers are set
trafficstars
Ariadne's make_executable_schema should by default check if fields on Query, Mutation and Subscription have set resolvers, and raise ValueError with appropriate type and field names to save dev from forgetting about those.
This option should be disableable in the case when API relies heavily on root_value or its only to keep schema browseable.
How about a bindable that checks this? You could opt in by passing it as the last type definition.
This could even be an util called after make_executable_schema, eg:
schema = make_executable_schema(...)
validate_root_resolvers_are_set(schema)
That way it'll be useful even after people do something to the schema after make_executable_schema()