@graphql-tools/utils 7.6.0 → 7.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,13 @@
1
+ import { DocumentNode, GraphQLResolveInfo } from 'graphql';
2
+ import { ExecutionResult } from './Interfaces';
3
+ export interface ExecutionParams<TArgs = Record<string, any>, TContext = any> {
4
+ document: DocumentNode;
5
+ variables?: TArgs;
6
+ extensions?: Record<string, any>;
7
+ context?: TContext;
8
+ info?: GraphQLResolveInfo;
9
+ }
10
+ export declare type AsyncExecutor<TBaseContext = Record<string, any>> = <TReturn = Record<string, any>, TArgs = Record<string, any>, TContext = TBaseContext>(params: ExecutionParams<TArgs, TContext>) => Promise<ExecutionResult<TReturn>>;
11
+ export declare type SyncExecutor<TBaseContext = Record<string, any>> = <TReturn = Record<string, any>, TArgs = Record<string, any>, TContext = TBaseContext>(params: ExecutionParams<TArgs, TContext>) => ExecutionResult<TReturn>;
12
+ export declare type Executor<TBaseContext = Record<string, any>> = <TReturn = Record<string, any>, TArgs = Record<string, any>, TContext = TBaseContext>(params: ExecutionParams<TArgs, TContext>) => ExecutionResult<TReturn> | Promise<ExecutionResult<TReturn>>;
13
+ export declare type Subscriber<TBaseContext = Record<string, any>> = <TReturn = Record<string, any>, TArgs = Record<string, any>, TContext = TBaseContext>(params: ExecutionParams<TArgs, TContext>) => Promise<AsyncIterator<ExecutionResult<TReturn>> | ExecutionResult<TReturn>>;
package/es5/index.cjs.js CHANGED
@@ -1788,7 +1788,7 @@ function createNamedStub(name, type) {
1788
1788
  return new constructor({
1789
1789
  name: name,
1790
1790
  fields: {
1791
- __fake: {
1791
+ _fake: {
1792
1792
  type: graphql.GraphQLString,
1793
1793
  },
1794
1794
  },
@@ -1811,7 +1811,7 @@ function isNamedStub(type) {
1811
1811
  if (graphql.isObjectType(type) || graphql.isInterfaceType(type) || graphql.isInputObjectType(type)) {
1812
1812
  var fields = type.getFields();
1813
1813
  var fieldNames = Object.keys(fields);
1814
- return fieldNames.length === 1 && fields[fieldNames[0]].name === '__fake';
1814
+ return fieldNames.length === 1 && fields[fieldNames[0]].name === '_fake';
1815
1815
  }
1816
1816
  return false;
1817
1817
  }