You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 and parseLiteral produce a internalInputValue and serializeAsLiteral converts the internalInputValue to a literal.
First rough idea (I am sure we can do better, just to start the discussion)
coerceOutput or coerceResult (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 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
parseValuedoesn't parse anything, but convert a runtime input value to an internal value.In my mental model
parseValueandparseLiteralproduce ainternalInputValueandserializeAsLiteralconverts theinternalInputValueto aliteral.First rough idea (I am sure we can do better, just to start the discussion)
coerceOutputorcoerceResult(the spec talks about result coercion, but output would mirror input)coerceInputValuecoerceInputLiteralcoerceInternalValueAsLiteralIn 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.