import type { ExecutionResult } from 'graphql/execution' ; import type { TypedQueryDocumentNode } from 'graphql/utilities' ; import { parse } from 'graphql/language' ; import { execute } from 'graphql/execution' ; import { buildSchema } from 'graphql/utilities' ; const schema = buildSchema ( `
  type Query {
    test: String
  }
` ) ; const queryDocument = parse ( '{ test }' ) ; type ResponseData = { test : string ; } ; const typedQueryDocument = queryDocument as TypedQueryDocumentNode < ResponseData , { } > ; execute ( { schema , document : typedQueryDocument } ) ; function wrappedExecute < T > ( document ) { return execute ( { schema , document } ) as ExecutionResult < T > ; } const response = wrappedExecute ( typedQueryDocument ) ; const responseData = response . data ; declare function runQueryA ( q ) ; declare const optionalInputRequiredOutput ; runQueryA ( optionalInputRequiredOutput ) ; declare function runQueryB ( q ) ; runQueryB ( optionalInputRequiredOutput ) ; declare const optionalInputOptionalOutput ; runQueryB ( optionalInputOptionalOutput ) ; declare const requiredInputRequiredOutput ; runQueryB ( requiredInputRequiredOutput ) ; declare const requiredInputOptionalOutput ; runQueryB ( requiredInputOptionalOutput ) ;