From 50dede08631920c56c7893d435224085d60a7084 Mon Sep 17 00:00:00 2001 From: Jason Deutsch Date: Mon, 31 Aug 2020 13:27:36 -0500 Subject: [PATCH] add OperationName to IntrospectionQuery Query (#11) Co-authored-by: Jason Deutsch --- introspection.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/introspection.go b/introspection.go index 4d0a5e2..69fbf04 100644 --- a/introspection.go +++ b/introspection.go @@ -8,6 +8,7 @@ import ( "github.com/vektah/gqlparser/v2/ast" ) + // 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) { @@ -50,8 +51,13 @@ func IntrospectAPI(queryer Queryer) (*ast.Schema, error) { // a place to hold the result of firing the introspection query result := IntrospectionQueryResult{} + input := &QueryInput{ + Query: IntrospectionQuery, + OperationName: "IntrospectionQuery", + } + // fire the introspection query - err := queryer.Query(context.Background(), &QueryInput{Query: IntrospectionQuery}, &result) + err := queryer.Query(context.Background(), input, &result) if err != nil { return nil, err }