harmboschloo / graphql-to-elm / GraphQL.Errors

Types and decoder for the errors field in the GraphQL response. See http://spec.graphql.org/June2018/#sec-Errors.


type alias Errors =
List Error


type alias Error =
{ message : String
, locations : Maybe (List Location)
, path : Maybe (List PathSegment) 
}


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


type PathSegment
    = FieldName String
    | ListIndex Basics.Int

decoder : Json.Decode.Decoder Errors

errorDecoder : Json.Decode.Decoder Error

locationDecoder : Json.Decode.Decoder Location

pathSegmentDecoder : Json.Decode.Decoder PathSegment