graphene icon indicating copy to clipboard operation
graphene copied to clipboard

Default value for Argument's should be Undefined

Open ewhauser opened this issue 4 years ago • 4 comments

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.

ewhauser avatar May 02 '20 20:05 ewhauser

@ewhauser is this still an issue? (sorry I haven't been paying attention to this part of the library)

jkimbo avatar Aug 05 '20 19:08 jkimbo

AFAIK - yes. However, we are still on graphene-3.0b3 so it is possible the behavior was corrected since then.

ewhauser avatar Aug 05 '20 19:08 ewhauser

Ok well if it is then a PR to fix it would be appreciated

jkimbo avatar Aug 05 '20 19:08 jkimbo

I'm having the same issue with 3.0.0b7

lovetoburnswhen avatar Jun 17 '21 17:06 lovetoburnswhen

Fixed: https://github.com/graphql-python/graphene/commit/19ebf08339263f0446235ddffbbab0e6d3f11699

erikwrede avatar Aug 13 '22 13:08 erikwrede