dillonkearns / elm-graphql / Graphql.Http.GraphqlError


type alias GraphqlError =
{ message : String
, locations : Maybe (List Location)
, details : Dict String Json.Decode.Value 
}

Represents an error from the GraphQL endpoint. Also see Graphql.Http.

The code generated by dillonkearns/elm-graphql guarantees that your requests are valid according to the server's schema, so the two cases where you will get a GraphqlError are 1) when there is an implicit constraint that the schema doesn't specify, or 2) when your generated code is out of date with the schema.

See the Errors section in the GraphQL spec for more details about GraphQL errors.

decoder : Json.Decode.Decoder (List GraphqlError)

For internal use only.


type alias Location =
{ line : Basics.Int
, column : Basics.Int 
}

The location in the GraphQL query document where the error occured


type PossiblyParsedData parsed
    = ParsedData parsed
    | UnparsedData Json.Decode.Value

Represents the data field in cases where there is an error present, see the error section in the GraphQL spec If the decoder succeeds you will end up with ParsedData. If it fails, you will get an UnparsedData with a Json.Decode.Value containing the raw, undecoded data field. You're likely to end up with UnparsedData since GraphQL will return null if there is an error on a non-nullable field , which will cause the decode pipeline to fail and give you UnparsedData.