forked from wundergraph/graphql-go-tools
-
Notifications
You must be signed in to change notification settings - Fork 4
/
const.go
55 lines (48 loc) · 1.53 KB
/
const.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package resolve
import "errors"
var (
lBrace = []byte("{")
rBrace = []byte("}")
lBrack = []byte("[")
rBrack = []byte("]")
comma = []byte(",")
colon = []byte(":")
quote = []byte("\"")
quotedComma = []byte(`","`)
null = []byte("null")
literalData = []byte("data")
literalTrue = []byte("true")
literalFalse = []byte("false")
literalErrors = []byte("errors")
literalMessage = []byte("message")
literalLocations = []byte("locations")
literalLine = []byte("line")
literalColumn = []byte("column")
literalPath = []byte("path")
literalExtensions = []byte("extensions")
literalTrace = []byte("trace")
unableToResolveMsg = []byte("unable to resolve")
emptyArray = []byte("[]")
emptyObject = []byte("{}")
)
var (
errNonNullableFieldValueIsNull = errors.New("non Nullable field value is null")
errInvalidFieldValue = errors.New("invalid field value")
errTypeNameSkipped = errors.New("skipped because of __typename condition")
errHeaderPathInvalid = errors.New("invalid header path: header variables must be of this format: .request.header.{{ key }} ")
ErrUnableToResolve = errors.New("unable to resolve operation")
)
var (
errorPaths = [][]string{
{"message"},
{"locations"},
{"path"},
{"extensions"},
}
)
const (
errorsMessagePathIndex = 0
errorsLocationsPathIndex = 1
errorsPathPathIndex = 2
errorsExtensionsPathIndex = 3
)