`make_executable_schema`'s omits default enum values in args and inputs
See original GitHub issueGraphQL enums are represented in Python via the GraphQLEnumType
. If those types are created from the SDL, they define no Python representation for GraphQL enum items. Developers can use Ariadne-provided EnumType
to specify how enum items should be represented in Python themselves, but we also include “fallback” step that fills enum values with their str
representations.
However neither of those approaches takes care of enum items defined as default values for field arguments. Eg:
type Query {
users(role: UserRole = ADMIN): [User]
}
input FooBarInput {
foo: FooEnum! = FOO
}
We will need to add additional step to make_executable_schema
that gathers all enums from schema together with their Python representations, and then introspects schema’s fields values for places where field or input has default value type of enum. If this is the case, we should set correct default_value
on GraphQLArgument
in the schema.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:14 (11 by maintainers)
I don’t know if this is the right place to discuss this issue (it seems related to enums and default values):
There seems to be a regression in ariadne 0.13.0. Or at least an unexpected change in behaviour when I upgraded from 0.12.0.
If you run the following:
This works fine under the environment:
But when run under the environment:
It produces the error:
Has there been any movement on the schema validation solution/workaround that would unblock this issue? My team is working on a project that is currently using workarounds for this and we’d like to remove them.