Skip to content

Commit

Permalink
remove resolver from query package
Browse files Browse the repository at this point in the history
  • Loading branch information
neelance committed Mar 18, 2017
1 parent 2e23573 commit adeb53d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion internal/exec/introspection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
12 changes: 1 addition & 11 deletions internal/query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand All @@ -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
}

Expand Down

0 comments on commit adeb53d

Please sign in to comment.