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.

Default value for Argument's should be Undefined

See original GitHub issue

When 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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lovetoburnswhencommented, Jun 17, 2021

I’m having the same issue with 3.0.0b7

Read more comments on GitHub >

github_iconTop 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 >

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