Skip to content

Commit 3adb2f5

Browse files
committed
Do not emit JSON when there is no error locations
Just conform to the spec : 7.1.2 If an error can be associated to a particular point in the requested GraphQL document, it should contain an entry with the key locations....
1 parent 9441c49 commit 3adb2f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gqlerrors/formatted.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type ExtendedError interface {
1313

1414
type FormattedError struct {
1515
Message string `json:"message"`
16-
Locations []location.SourceLocation `json:"locations"`
16+
Locations []location.SourceLocation `json:"locations,omitempty"`
1717
Path []interface{} `json:"path,omitempty"`
1818
Extensions map[string]interface{} `json:"extensions,omitempty"`
1919
originalError error

0 commit comments

Comments
 (0)