MCPcopy Create free account
hub / github.com/vektah/gqlparser / LoadQuery

Function LoadQuery

gqlparser.go:35–51  ·  view source on GitHub ↗

Deprecated: use LoadQueryWithRules instead.

(schema *ast.Schema, str string)

Source from the content-addressed store, hash-verified

33
34// Deprecated: use LoadQueryWithRules instead.
35func LoadQuery(schema *ast.Schema, str string) (*ast.QueryDocument, gqlerror.List) {
36 query, err := parser.ParseQuery(&ast.Source{Input: str})
37 if err != nil {
38 gqlErr := &gqlerror.Error{}
39 ok := errors.As(err, &gqlErr)
40 if ok {
41 return nil, gqlerror.List{gqlErr}
42 }
43 return nil, gqlerror.List{gqlerror.Wrap(err)}
44 }
45 errs := validator.Validate(schema, query)
46 if len(errs) > 0 {
47 return nil, errs
48 }
49
50 return query, nil
51}
52
53func LoadQueryWithRules(
54 schema *ast.Schema,

Callers 1

MustLoadQueryFunction · 0.85

Calls 4

ParseQueryFunction · 0.92
WrapFunction · 0.92
ValidateFunction · 0.92
AsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…