Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upadd custom scalar Specification URL #1772
Merged
Conversation
| .defaultValue("No longer supported") | ||
| .description("The reason for the deprecation")) | ||
| .validLocations(FIELD_DEFINITION, ENUM_VALUE) | ||
| .build(); | ||
|
|
||
| /** | ||
| * The "specifiedBy" directive allows to provide a specification URL for a Scala |
bbakerman
May 21, 2020
Member
spillin - Scalar (not Scala - never Scala)
spillin - Scalar (not Scala - never Scala)
| @@ -73,10 +74,16 @@ public GraphQLScalarType(String name, String description, Coercing coercing) { | |||
| @Internal | |||
| @Deprecated | |||
| public GraphQLScalarType(String name, String description, Coercing coercing, List<GraphQLDirective> directives, ScalarTypeDefinition definition) { | |||
bbakerman
May 21, 2020
Member
one version we need to remove the old constructors!
one version we need to remove the old constructors!
| } | ||
| Argument urlArgument = specifiedByDirective.get().getArgument("url"); | ||
| StringValue url = (StringValue) urlArgument.getValue(); | ||
| return url.getValue(); |
bbakerman
May 21, 2020
Member
Thought - Will it always be non null arg values?
Thought - Will it always be non null arg values?
andimarek
May 21, 2020
Author
Member
yes it is: url is required non null
yes it is: url is required non null
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
This is a major new feature for GraphQL: it allows you to specify a url for a custom scalar which should point to a document describing this scalar.
It is implemented via directive for SDL or as property on GraphQLScalar.
The specifiedByUrl can then be queried via Introspection:
{__type(name: "MyScalar") {name specifiedByUrl} }See graphql/graphql-spec#649 and graphql/graphql-js#2276 for all the details.