You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use of the deprecated GraphQL-Java method .defaultValue() rather than defaultValueProgrammatic() to specify default null value had resulted in schema linting issues and broken Apollo code generation tooling, but does not cause any immediate errors upon initial schema generation. Removing this deprecated method entirely would prevent this prevent users from having to create to manually check for usage of .defaultValue( null ) in their projects.
For example when creating a schema generated using SchemaPrinter, usage of .defaultValue( null ) with arguments and with input objects fields will result in the following:
TestQuery(
testArg: Boolean = ,
)
input TestInput {
testField: Boolean =
}
Rather than:
TestQuery(
testArg: Boolean = null,
)
input TestInput {
testField: Boolean = null
}
In the JSON schema generated using IntrospectionQuery, this incorrectly manifests itself as shown below with defaultValue: "" . This breaks Apollo code generation tooling.
Activity
bbakerman commentedon Aug 8, 2023
just to confirm - you are manually creating
graphql.schema.GraphQLArgumentand calling.defaultValue( null )in that code?I want to ensure its not something that the SDL text -> schema is doing
georgeVlady0 commentedon Aug 8, 2023
Hey, yes I can confirm that this issue results in manually creating
graphql.schema.GraphQLArgumentand calling.defaultValue( null )bbakerman commentedon Aug 9, 2023
I have made a reproduction test and can confirm this problem - we will look into this and see what's happening
georgeVlady0 commentedon Aug 9, 2023
Thank you!
dondonz commentedon Aug 22, 2023
Merged in #3286