Formerly ryannhg/graphql. Search finds this package by either name.
Using the GraphQL.Decode.scalar and GraphQL.Encode.scalar functions, you can define
Elm modules like this one in your own codebase for any custom scalars you need.
Because the ID scalar is built-in to the GraphQL specification, we provide this one for
you by default. Your custom scalars will also include a decoder / encode function so they
are easy to reuse across your application!
Use a String value to create a new ID:
import GraphQL.Scalar.Id exposing (Id)
id : Id
id =
GraphQL.Scalar.Id.fromString "12a4bf"Use a Int value to create a new ID:
import GraphQL.Scalar.Id exposing (Id)
id : Id
id =
GraphQL.Scalar.Id.fromInt 123
Represents a GraphQL
IDscalar value.