diff --git a/graphql.go b/graphql.go index e37c836f195..0f34c777f59 100644 --- a/graphql.go +++ b/graphql.go @@ -99,7 +99,7 @@ func (s *Schema) Exec(ctx context.Context, queryString string, operationName str panic("schema created without resolver, can not exec") } - document, err := query.Parse(queryString, s.schema.Resolve) + document, err := query.Parse(queryString) if err != nil { return &Response{ Errors: []*errors.QueryError{err}, diff --git a/internal/exec/introspection.go b/internal/exec/introspection.go index 0c6150064bc..fb78a550a37 100644 --- a/internal/exec/introspection.go +++ b/internal/exec/introspection.go @@ -54,7 +54,7 @@ var introspectionQuery *query.Document func init() { var err *errors.QueryError - introspectionQuery, err = query.Parse(introspectionQuerySrc, schema.Meta.Resolve) + introspectionQuery, err = query.Parse(introspectionQuerySrc) if err != nil { panic(err) } diff --git a/internal/query/query.go b/internal/query/query.go index 00933c827b1..cb9a6f91c8b 100644 --- a/internal/query/query.go +++ b/internal/query/query.go @@ -69,7 +69,7 @@ func (Field) isSelection() {} func (FragmentSpread) isSelection() {} func (InlineFragment) isSelection() {} -func Parse(queryString string, resolver common.Resolver) (*Document, *errors.QueryError) { +func Parse(queryString string) (*Document, *errors.QueryError) { sc := &scanner.Scanner{ Mode: scanner.ScanIdents | scanner.ScanInts | scanner.ScanFloats | scanner.ScanStrings, } @@ -84,16 +84,6 @@ func Parse(queryString string, resolver common.Resolver) (*Document, *errors.Que return nil, err } - for _, op := range doc.Operations { - for _, v := range op.Vars.Fields { - t, err := common.ResolveType(v.Type, resolver) - if err != nil { - return nil, errors.Errorf("%s", err) - } - v.Type = t - } - } - return doc, nil }