diff --git a/graphql/response.go b/graphql/response.go index 927fabede6..6fe55d56dc 100644 --- a/graphql/response.go +++ b/graphql/response.go @@ -8,9 +8,12 @@ import ( "github.com/vektah/gqlparser/gqlerror" ) +// Errors are intentionally serialized first based on the advice in +// https://github.com/facebook/graphql/commit/7b40390d48680b15cb93e02d46ac5eb249689876#diff-757cea6edf0288677a9eea4cfc801d87R107 +// and https://github.com/facebook/graphql/pull/384 type Response struct { - Data json.RawMessage `json:"data"` Errors gqlerror.List `json:"errors,omitempty"` + Data json.RawMessage `json:"data"` Extensions map[string]interface{} `json:"extensions,omitempty"` }