Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
agnivade committed Dec 15, 2021
1 parent dbe08ed commit 1e28663
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
"reflect"
"time"

"github.com/graph-gophers/graphql-go/errors"
Expand Down Expand Up @@ -197,7 +196,7 @@ func (s *Schema) ValidateWithVariables(queryString string, variables map[string]
// without a resolver. If the context get cancelled, no further resolvers will be called and a
// the context error will be returned as soon as possible (not immediately).
func (s *Schema) Exec(ctx context.Context, queryString string, operationName string, variables map[string]interface{}) *Response {
if s.res.Resolver == (reflect.Value{}) {
if !s.res.Resolver.IsValid() {
panic("schema created without resolver, can not exec")
}
return s.exec(ctx, queryString, operationName, variables, s.res)
Expand Down
8 changes: 4 additions & 4 deletions internal/schema/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -995,13 +995,13 @@ func TestInterfaceImplementsInterface(t *testing.T) {
if tt.validateError == nil {
t.Fatal(err)
}
if err := tt.validateError(err); err != nil {
t.Fatal(err)
if err2 := tt.validateError(err); err2 != nil {
t.Fatal(err2)
}
}
if tt.validateSchema != nil {
if err := tt.validateSchema(s); err != nil {
t.Fatal(err)
if err2 := tt.validateSchema(s); err2 != nil {
t.Fatal(err2)
}
}
})
Expand Down
2 changes: 1 addition & 1 deletion relay/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func UnmarshalKind(id graphql.ID) string {
if err != nil {
return ""
}
i := strings.IndexByte(string(s), ':')
i := strings.IndexByte(string(s), ':')
if i == -1 {
return ""
}
Expand Down

0 comments on commit 1e28663

Please sign in to comment.