question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support nullable types in graphene

See original GitHub issue

Is 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:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jkimbocommented, Aug 14, 2021

@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.py

0reactions
alex-grovercommented, Aug 31, 2021

it is possible that the issue is the missing comma in the input? {modelName: "model1" mode: null}

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lists and Non-Null - Graphene-Python
Lists and Non-Null¶. Object types, scalars, and enums are the only kinds of types you can define in Graphene. But when you use...
Read more >
Using nullability in GraphQL
A field can either be nullable or non-null, and this tells you whether or not you could receive a null value when you...
Read more >
Graphene Python Lists resolve null for all fields - Stack Overflow
I am working with GraphQL in python am trying to resolve list data but the fields are resolving null. How can ...
Read more >
Graphene Documentation - Read the Docs
To define a list without any nullable items the type needs to be marked as NonNull. For example: import graphene class Character(graphene.
Read more >
GraphQL Nullability - Episode #42
The GraphQL type system has built-in support for null, and non-null fields. GraphQL is null by default. Consider the following schema:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found