-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Parameterized introspection queries #2993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1b0d164
966309e
f64f1e6
438ce16
f0ee674
887a9c7
2b1b786
e0adefe
adafa6a
3cef2a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,7 +90,7 @@ public enum TypeKind { | |
| public static final GraphQLEnumType __TypeKind = GraphQLEnumType.newEnum() | ||
| .name("__TypeKind") | ||
| .description("An enum describing what kind of type a given __Type is") | ||
| .value("SCALAR", TypeKind.SCALAR, "Indicates this type is a scalar. 'specifiedByUrl' is a valid field") | ||
| .value("SCALAR", TypeKind.SCALAR, "Indicates this type is a scalar. 'specifiedByURL' is a valid field") | ||
| .value("OBJECT", TypeKind.OBJECT, "Indicates this type is an object. `fields` and `interfaces` are valid fields.") | ||
| .value("INTERFACE", TypeKind.INTERFACE, "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.") | ||
| .value("UNION", TypeKind.UNION, "Indicates this type is a union. `possibleTypes` is a valid field.") | ||
|
|
@@ -398,8 +398,13 @@ private static String printDefaultValue(InputValueWithState inputValueWithState, | |
| .name("ofType") | ||
| .type(typeRef("__Type"))) | ||
| .field(newFieldDefinition() | ||
| .name("specifiedByUrl") | ||
| .name("specifiedByURL") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is wrong in both cases https://spec.graphql.org/draft/#sec--specifiedBy It probably should be
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even if we go with this new name - it a breaking change - anyone using it today would be broken We need to add a new field and deprecate the old if we changed. What does graphql-js do here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
unless I am mistaken, the field is the one here: https://spec.graphql.org/draft/#sec-Schema-Introspection.Schema-Introspection-Schema
they currently only support the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's put both fields in, deprecate the old and laugh about it on 20 years
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above - add a new field and deprecate the old |
||
| .type(GraphQLString)) | ||
| .field(newFieldDefinition() | ||
| .name("specifiedByUrl") | ||
| .type(GraphQLString) | ||
| .deprecate("see `specifiedByURL`") | ||
| ) | ||
| .build(); | ||
|
|
||
| static { | ||
|
|
@@ -412,7 +417,8 @@ private static String printDefaultValue(InputValueWithState inputValueWithState, | |
| register(__Type, "ofType", OfTypeFetcher); | ||
| register(__Type, "name", nameDataFetcher); | ||
| register(__Type, "description", descriptionDataFetcher); | ||
| register(__Type, "specifiedByUrl", specifiedByUrlDataFetcher); | ||
| register(__Type, "specifiedByURL", specifiedByUrlDataFetcher); | ||
| register(__Type, "specifiedByUrl", specifiedByUrlDataFetcher); // note that this field is deprecated | ||
| } | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it seems that graphql-js chose the name
specifiedByURLand we chosespecifiedByUrl(Which is ironical because @andimarek drove this change in spec terms)
I think we should align to the reference implementation in this case - since it drives tooling behavior
But for backwards compat - we should "add" a new field and not change its name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will adafa6a#diff-eba216571550152c40136483beff9a41311df7b7681264e65d8d0e7c866cff7eR403 suffice? I could revert or add new tests for it as well.