Skip to content

Allow implementing field arguments to use different defaults - #4491

Open
goutamadwant wants to merge 1 commit into
graphql-java:masterfrom
goutamadwant:fix/interface-argument-defaults
Open

goutamadwant wants to merge 1 commit into
graphql-java:masterfrom
goutamadwant:fix/interface-argument-defaults

Conversation

@goutamadwant

Copy link
Copy Markdown

Summary

Allow an implementing field argument to use a different default from its interface argument. The GraphQL specification requires the argument name and type to match, but does not require matching defaults.

SDL and programmatic schema validation now compare argument types without comparing defaults. Checks for missing arguments, incompatible types, and additional required arguments remain in place. Execution continues to use the concrete field's default.

Tests

  • Added Spock coverage for object and interface implementations, differing and one-sided defaults, and execution through an interface.
  • ./gradlew test --tests 'graphql.schema.idl.*' --tests 'graphql.schema.validation.*' --tests graphql.InterfacesImplementingInterfacesTest (599 tests passed).

Fixes #4480.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A schema is refused when an implementing field's argument default differs from the interface's

1 participant