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
{{ message }}
Repository navigation
Fill in default values for missing arguments on applied directives #821
When an applied directive leaves out an argument that has a default value, SchemaParser builds the GraphQLAppliedDirective without that argument. graphql-java's own SchemaGenerator adds the missing arguments with their defaults (SchemaGeneratorAppliedDirectiveHelper.transferMissingAppliedArguments), so the two produce different schemas from the same SDL.
#818 works around this for @deprecated only, because a bare @deprecated with no reason makes SchemaPrinter throw a NPE. The general fix is to do the same for every directive in SchemaParser.buildAppliedDirectives: for each argument of the directive definition that isn't in the applied directive but has a default, add it with the default value. The @deprecated special case can then be removed.
This changes behaviour: code that expects getArgument(...) to be null for an omitted argument will now get the default value, so it should go in a minor release with a note in the release notes.
Activity