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
It seems graphqelm will generate incorrect encoders if the record type contains reserved keywords like type.
Generated Code (Incorrect):
{-| Type for the Input input object.
-}
type alias Input =
{ apiVersion : String, type_ : String, payload : String }
{-| Encode a Input into a value that can be used as an argument.
-}
encodeInput : Input -> Value
encodeInput input =
Encode.maybeObject
[ ( "apiVersion", Encode.string input.apiVersion |> Just ), ( "type_", Encode.string input.type_ |> Just ), ( "payload", Encode.string input.payload |> Just ) ]
In the above example, graphqelm should generate encoder as follows:
{-| Encode a Input into a value that can be used as an argument.
-}
encodeInput : Input -> Value
encodeInput input =
Encode.maybeObject
[ ( "apiVersion", Encode.string input.apiVersion |> Just ), ( "type", Encode.string input.type_ |> Just ), ( "payload", Encode.string input.payload |> Just ) ]
Notice the lack of _ in the string type
The text was updated successfully, but these errors were encountered:
It seems graphqelm will generate incorrect encoders if the record type contains reserved keywords like
type
.Generated Code (Incorrect):
Schema:
In the above example,
graphqelm
should generate encoder as follows:Notice the lack of
_
in the stringtype
The text was updated successfully, but these errors were encountered: