File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ import {
1010 hasPersistedQueryError ,
1111 mergeHeaders ,
1212} from "./helpers" ;
13- import { print } from "graphql/language/printer" ;
14- import { ASTNode } from "graphql" ;
13+ import { print , ASTNode } from "graphql" ;
1514
1615type Options = {
1716 /**
@@ -70,7 +69,7 @@ export const initClientFetcher =
7069 if ( ! options . signal ) {
7170 options . signal = AbortSignal . timeout ( defaultTimeout ) ;
7271 }
73- const query = print ( astNode as ASTNode ) ;
72+ const query = JSON . parse ( print ( astNode as ASTNode ) ) ;
7473 const operationName = extractOperationName ( query ) ;
7574
7675 let hash = "" ;
Original file line number Diff line number Diff line change @@ -11,8 +11,7 @@ import {
1111 getQueryType ,
1212 pruneObject ,
1313} from "./helpers" ;
14- import { print } from "graphql/language/printer" ;
15- import { ASTNode } from "graphql" ;
14+ import { print , ASTNode } from "graphql" ;
1615
1716type Options = {
1817 /**
@@ -51,7 +50,7 @@ export const initServerFetcher =
5150 { cache, next = { } } : CacheOptions ,
5251 signal : AbortSignal = AbortSignal . timeout ( defaultTimeout )
5352 ) : Promise < GqlResponse < TResponse > > => {
54- const query = print ( astNode as ASTNode ) ;
53+ const query = JSON . parse ( print ( astNode as ASTNode ) ) ;
5554 const operationName = extractOperationName ( query ) || "(GraphQL)" ;
5655
5756 if ( dangerouslyDisableCache ) {
Original file line number Diff line number Diff line change @@ -9,4 +9,8 @@ export class TypedDocumentString<TResult, TVariables>
99 constructor ( private value : string , public __meta__ ?: Record < string , any > ) {
1010 super ( value ) ;
1111 }
12+
13+ // Choosing a leaf type will trigger the print visitor to output the value directly
14+ // instead of trying to visit the children
15+ kind = "StringValue" ;
1216}
You can’t perform that action at this time.
0 commit comments