Skip to content

Fix #296: Introspection on default value for input object is not following GraphQL spec - #297

Closed
dminkovsky wants to merge 1 commit into
graphql-java:masterfrom
dminkovsky:gh-296-introspection-input-object-default-value
Closed

dminkovsky wants to merge 1 commit into
graphql-java:masterfrom
dminkovsky:gh-296-introspection-input-object-default-value

Conversation

@dminkovsky

@dminkovsky dminkovsky commented Jan 12, 2017 •

Copy link
Copy Markdown
Contributor

Relevant lines:

if (environment.getSource() instanceof GraphQLArgument) {
GraphQLArgument inputField = (GraphQLArgument) environment.getSource();
return inputField.getDefaultValue() != null ? inputField.getDefaultValue().toString() : null;
} else if (environment.getSource() instanceof GraphQLInputObjectField) {
GraphQLInputObjectField inputField = (GraphQLInputObjectField) environment.getSource();
return inputField.getDefaultValue() != null ? inputField.getDefaultValue().toString() : null;

I think this will require #126


def "test"() {

def graphql = GraphQL.newGraphQL(newSchema()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use TestUtil.schemaWithInputType(inputType)

@nex-ray

nex-ray commented Jan 13, 2017

Copy link
Copy Markdown

This unit test checks the exact reported issue. Thanks.

To make unit test for default value more complete, we should include testing with other value types as well, including list and enum etc.

@dminkovsky

dminkovsky commented Jan 13, 2017 via email

Copy link
Copy Markdown
Contributor Author

@bbakerman

Copy link
Copy Markdown
Member

This PR fixes this issue and adds a shed load more functionality at the same time

https://github.com/graphql-java/graphql-java/pull/388/files

@bbakerman

Copy link
Copy Markdown
Member

This is no longer needed as is

@bbakerman bbakerman closed this May 1, 2017
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.

3 participants