elm-graphql
elm-graphql copied to clipboard
A GraphQL response does not require the data field
https://github.com/ghivert/elm-graphql/blob/240f23903750c1047a53c77f93f72dc4ccb6e55f/src/GraphQl/Http.elm#L41
This is an incorrect assumption. You can get a valid response with just an errors field.
According to https://spec.graphql.org/draft/#sec-Response-Format GraphQL requests should produce something like this:
type alias GQLError =
{ message : String
, path : List String
, locations : …
, extensions : …
}
type alias GQLResponse =
{ errors: Maybe (List GQLError)
, data: Maybe Value
, extensions: Maybe Value
}