Skip to content

Commit

Permalink
fixed error assigning kind to input object
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecAivazis committed Jul 16, 2019
1 parent 42ac2d2 commit 78e82fe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 3 additions & 0 deletions introspection.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
// IntrospectRemoteSchema is used to build a RemoteSchema by firing the introspection query
// at a remote service and reconstructing the schema object from the response
func IntrospectRemoteSchema(url string) (*RemoteSchema, error) {

// introspect the schema at the designated url
schema, err := IntrospectAPI(NewSingleRequestQueryer(url))
if err != nil {
Expand Down Expand Up @@ -236,6 +237,8 @@ func introspectionUnmarshalType(schemaType IntrospectionQueryFullType) *ast.Defi
definition.Kind = ast.Interface
case "UNION":
definition.Kind = ast.Union
case "INPUT_OBJECT":
definition.Kind = ast.InputObject
case "ENUM":
definition.Kind = ast.Enum
// save the enum values
Expand Down
1 change: 1 addition & 0 deletions introspection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ func TestIntrospectQueryUnmarshalType_inputObjects(t *testing.T) {
// make sure the object meta data is right
assert.Equal(t, "InputObjectType", object.Name)
assert.Equal(t, "Description", object.Description)
assert.Equal(t, ast.InputObject, object.Kind)

// we should have added a single field
if len(object.Fields) != 1 {
Expand Down
4 changes: 0 additions & 4 deletions queryerMultiOp.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"errors"
"fmt"
"net/http"
"time"

Expand Down Expand Up @@ -93,7 +92,6 @@ func (q *MultiOpQueryer) Query(ctx context.Context, input *QueryInput, receiver
}

func (q *MultiOpQueryer) loadQuery(ctx context.Context, keys dataloader.Keys) []*dataloader.Result {
fmt.Println("loading keys", len(keys))
// a place to store the results
results := []*dataloader.Result{}

Expand Down Expand Up @@ -133,8 +131,6 @@ func (q *MultiOpQueryer) loadQuery(ctx context.Context, keys dataloader.Keys) []
results = append(results, &dataloader.Result{Data: result})
}

fmt.Println("total results", len(results))

// return the results
return results
}

0 comments on commit 78e82fe

Please sign in to comment.