From 29d1fdcc49045334e94e8efa1025ebed9f57bb35 Mon Sep 17 00:00:00 2001 From: Sashko Stubailo Date: Thu, 23 Jun 2016 17:15:20 -0700 Subject: [PATCH] Add error path to response Just like it is helpful to know the location in the query associated with an error, it's helpful to know the location in the response. --- spec/Section 7 -- Response.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/Section 7 -- Response.md b/spec/Section 7 -- Response.md index 14c950cf7..6a47d5018 100644 --- a/spec/Section 7 -- Response.md +++ b/spec/Section 7 -- Response.md @@ -111,6 +111,12 @@ locations, where each location is a map with the keys `line` and `column`, both positive numbers starting from `1` which describe the beginning of an associated syntax element. +If an error can be associated to a particular field in the GraphQL response, it +should contain an entry with the key `path` with a list of path segments +starting at the root of the response and ending with the field associated with +the error. Path segments that represent object fields should be strings, and +path segments that represent array indices should be 0-indexed integers. + GraphQL servers may provide additional entries to error as they choose to produce more helpful or machine-readable errors, however future versions of the spec may describe additional entries to errors.