Configurable literal coercion #2

Open
opened 2023-03-04 07:47:13 +01:00 by belka · 0 comments
Owner

coerceInputLiteral default scalars. There is now a way to add custom serialization and custom variable coercing, but coercing the literals isn't extendable.

The outcome of this issues should be the possibility to define custom scalar types.

  1. Rename coerceInputLiteral into coerceLiteral
  2. ScalarType should probably have an additional constructor argument which saves the function Value -> Maybe Value which performs the coercion.
  3. Move hard-coded coercion to the function defined in 2.
  4. Update the documentation for coerceVariableValue and serialize - they should probably take a bit more responsibility if the built-in and custom scalars are going to be handled equally.
`coerceInputLiteral` default scalars. There is now a way to add custom serialization and custom variable coercing, but coercing the literals isn't extendable. The outcome of this issues should be the possibility to define custom scalar types. 1. Rename `coerceInputLiteral` into `coerceLiteral` 2. `ScalarType` should probably have an additional constructor argument which saves the function `Value` -> `Maybe Value` which performs the coercion. 3. Move hard-coded coercion to the function defined in 2. 4. Update the documentation for `coerceVariableValue` and `serialize` - they should probably take a bit more responsibility if the built-in and custom scalars are going to be handled equally.
belka added the
Kind
enhancement
label 2023-03-04 08:17:08 +01:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: OSS/graphql#2
No description provided.