Default value for Argument's should be Undefined
See original GitHub issueWhen upgrading from 2 to 3, the default value of Argument’s has changed from undefined to none which changes the schema. An example from test_relay_connection
:
type Query {
letters(before: String = null, after: String = null, first: Int = null, last: Int = null): LetterConnection
connectionLetters(before: String = null, after: String = null, first: Int = null, last: Int = null): LetterConnection
asyncLetters(before: String = null, after: String = null, first: Int = null, last: Int = null): LetterConnection
node(
"""The ID of the object"""
id: ID!
): Node
}
which should be:
type Query {
letters(before: String, after: String, first: Int, last: Int): LetterConnection
connectionLetters(before: String, after: String, first: Int, last: Int): LetterConnection
asyncLetters(before: String, after: String, first: Int, last: Int): LetterConnection
node(
"""The ID of the object"""
id: ID!
): Node
}
Happy to submit a PR to fix if this is not intended behavior.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Override JavaScript default parameter with undefined
In JavaScript, function parameters default to undefined. However, it's often useful to set a different default value. This is where default ...
Read more >Default parameters - JavaScript - MDN Web Docs
Default function parameters allow named parameters to be initialized with default values if no value or undefined is passed.
Read more >Understanding Default Parameters in JavaScript - DigitalOcean
Without default parameters, you would have to explicitly check for undefined values in order to set defaults, as is shown in this example:....
Read more >required function parameters with default values #47202
Even when the type of the parameter is explicitly defined, it can still be undefined when it has a default value. This is...
Read more >Default Parameters in Javascript - Level Up Coding
In a function, Ii a parameter is not provided, then its value becomes undefined . In this case, the default value that we...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m having the same issue with 3.0.0b7
Fixed: https://github.com/graphql-python/graphene/commit/19ebf08339263f0446235ddffbbab0e6d3f11699