Skip to content

This provides @deprecated on input fields and arguments - #2186

Merged
bbakerman merged 4 commits into
masterfrom
input-deprecation
Mar 19, 2021
Merged

bbakerman merged 4 commits into
masterfrom
input-deprecation

Conversation

@bbakerman

@bbakerman bbakerman commented Feb 5, 2021 •

Copy link
Copy Markdown
Member

See #1770

See also https://github.com/smitt04/graphql/blob/ac15638ac02ac88013d838785d907c24bbaeff6b/spec/Section%204%20--%20Introspection.md

This now allows @deprecated to be on input fields and arguments.

type Query {
    someField(someArg : Int @deprecated) : String
}

input InputType {
    someInputField : String @deprecated
}    

} else if (environment.getSource() instanceof GraphQLInputObjectField) {
GraphQLInputObjectField inputField = environment.getSource();
} else if (type instanceof GraphQLInputObjectField) {
GraphQLInputObjectField inputField = (GraphQLInputObjectField) type;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

just tweaked it a little bit

filtered.remove(valueDefinition);
}
}
return filtered;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

tweaked the code to use .stream()

.type(newNonNullType(newTypeName().name("String").build()).build())
.build())
.build();
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

removed repeated definition and re-used the other ones

@dfa1

dfa1 commented Feb 6, 2021

Copy link
Copy Markdown
Contributor

in my team we really need this! As soon as is merged I could provide testing and feedback

@bbakerman bbakerman added this to the 17.0 milestone Feb 26, 2021
@vojtapol

vojtapol commented Mar 3, 2021

Copy link
Copy Markdown

Love this addition!

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