-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Rename Coercion functions #2357
Labels
Comments
Just for information. GraphQL.NET in v4 has 7 methods for any scalar . See ScalarGraphType. |
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this issue
Oct 7, 2024
following convention suggested in graphql#2357
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this issue
Oct 13, 2024
following convention suggested in graphql#2357
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this issue
Oct 13, 2024
following convention suggested in graphql#2357
yaacovCR
added a commit
that referenced
this issue
Oct 13, 2024
the new method was introduced in #3812 with upgrade path improved in #4209. This PR completes polishes this work a bit: 1. The method is renamed to `coerceInputLiteral()` following the naming convention suggested in #2357, with the other methods to be renamed in later PRs. 2. The type of the method `GraphQLScalarInputLiteralCoercer` is exported, which was not done in the initial work. The old `GraphQLScalarLiteralParser` type is deprecated.
yaacovCR
added a commit
that referenced
this issue
Oct 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Coercion functions for Scalars are currently named:
I don't think the current names align very well with the spec: the spec talks about "Result Coercion" and "Input Coercion". Also
parseValue
doesn't parse anything, but convert a runtime input value to an internal value.In my mental model
parseValue
andparseLiteral
produce ainternalInputValue
andserializeAsLiteral
converts theinternalInputValue
to aliteral
.First rough idea (I am sure we can do better, just to start the discussion)
coerceOutput
orcoerceResult
(the spec talks about result coercion, but output would mirror input)coerceInputValue
coerceInputLiteral
coerceInternalValueAsLiteral
In GraphQL Java we are also thinking about renaming (and adding a 4th one) and it would be great to have a discussion about a more clear naming.
The text was updated successfully, but these errors were encountered: