FSharp.Data.GraphQL icon indicating copy to clipboard operation
FSharp.Data.GraphQL copied to clipboard

Define mapping from custom scalar types to domain types on a client side

Open xperiandri opened this issue 5 years ago • 2 comments

Description

It would be extremely nice to be able to define a list of mapping between custom scalar types and real domain types. Like when you define coercion functions on server side. Otherwise now it is not convenient to use primitive types and you need to convert your operation response type to a domain type that requires you to either fill existing domain types or create new.

Expected behavior

When you define a provider you can pass a list of mappings with coercion functions the same as you use for custom scalar types on a server-side.

Actual behavior

Primitive types are used

Known workarounds

Write boilerplate code to transform them

Related information

  • FSharp.Data.GraphQL 1.0.5

xperiandri avatar Apr 05 '20 11:04 xperiandri

@xperiandri As mentioned on gitter, there is really no good solution for this until the Type Provider mechanism supports more options for extensibility i.e. language suggestion FS-1023.

johnberzy-bazinga avatar Apr 12 '20 21:04 johnberzy-bazinga

Related question over on Snowflaqe https://github.com/Zaid-Ajaj/Snowflaqe/issues/24

njlr avatar Apr 05 '24 07:04 njlr