Support nullable types in graphene
See original GitHub issueIs your feature request related to a problem? Please describe.
Do we have null type in graphene? The example, the default value of mode
is null is not pass null value,
mutation{ insertModel(input:{ modelName: "model1" })
but some cases we need to pass null, the return error is "Syntax Error GraphQL (4:63) Unexpected Name "null"
mutation{ insertModel(input:{ modelName: "model1" mode: null })
Describe the solution you’d like GraphQL supports null values, can graphene also support that? https://github.com/graphql/graphql-spec/pull/83
Describe alternatives you’ve considered A clear and concise description of any alternative solutions or features you’ve considered.
Additional context Add any other context or screenshots about the feature request here.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
@wodCZ you’re correct that in Graphene v2 that is the way to get it to work. However in Graphene v3, because it’s using graphql-core v3, you can use
null
in the query directly: https://replit.com/@jkimbo/Graphene-v3#main.pyit is possible that the issue is the missing comma in the input?
{modelName: "model1" mode: null}