Skip to content

Instantly share code, notes, and snippets.

@n1ru4l
Created June 10, 2021 07:05
Show Gist options
  • Save n1ru4l/03ea78c1a777bbea9dc23661e62d3dea to your computer and use it in GitHub Desktop.
Save n1ru4l/03ea78c1a777bbea9dc23661e62d3dea to your computer and use it in GitHub Desktop.
graphql-tools TS Strict diff
diff --git a/./diff/old/dist/batch-delegate/src/getLoader.d.ts b/./diff/new/dist/batch-delegate/src/getLoader.d.ts
index b00864d6..f8dd9c23 100644
--- a/./diff/old/dist/batch-delegate/src/getLoader.d.ts
+++ b/./diff/new/dist/batch-delegate/src/getLoader.d.ts
@@ -1,3 +1,3 @@
import DataLoader from 'dataloader';
import { BatchDelegateOptions } from './types';
-export declare function getLoader<K = any, V = any, C = K>(options: BatchDelegateOptions): DataLoader<K, V, C>;
+export declare function getLoader<K = any, V = any, C = K>(options: BatchDelegateOptions<any>): DataLoader<K, V, C>;
diff --git a/./diff/old/dist/batch-execute/src/getBatchingExecutor.d.ts b/./diff/new/dist/batch-execute/src/getBatchingExecutor.d.ts
index b38a6276..82e90832 100644
--- a/./diff/old/dist/batch-execute/src/getBatchingExecutor.d.ts
+++ b/./diff/new/dist/batch-execute/src/getBatchingExecutor.d.ts
@@ -1,3 +1,3 @@
import DataLoader from 'dataloader';
import { ExecutionParams, Executor } from '@graphql-tools/utils';
-export declare const getBatchingExecutor: (A1: Record<string, any>, A2: Executor<Record<string, any>>, A3: DataLoader.Options<any, any, any>, A4: (mergedExtensions: Record<string, any>, executionParams: ExecutionParams) => Record<string, any>) => Executor<Record<string, any>>;
+export declare const getBatchingExecutor: (A1: Record<string, any>, A2: Executor<Record<string, any>>, A3: DataLoader.Options<any, any, any> | undefined, A4: ((mergedExtensions: Record<string, any>, executionParams: ExecutionParams) => Record<string, any>) | undefined) => Executor<Record<string, any>>;
diff --git a/./diff/old/dist/batch-execute/src/prefix.d.ts b/./diff/new/dist/batch-execute/src/prefix.d.ts
index 24e11ef3..f4affe7e 100644
--- a/./diff/old/dist/batch-execute/src/prefix.d.ts
+++ b/./diff/new/dist/batch-execute/src/prefix.d.ts
@@ -1,5 +1,5 @@
export declare function createPrefix(index: number): string;
-export declare function parseKey(prefixedKey: string): {
+export declare function parseKey(prefixedKey: string): null | {
index: number;
originalKey: string;
};
diff --git a/./diff/old/dist/delegate/src/Subschema.d.ts b/./diff/new/dist/delegate/src/Subschema.d.ts
index 0d6766c4..5900d88c 100644
--- a/./diff/old/dist/delegate/src/Subschema.d.ts
+++ b/./diff/new/dist/delegate/src/Subschema.d.ts
@@ -13,7 +13,7 @@ export declare class Subschema<K = any, V = any, C = K, TContext = Record<string
batch?: boolean;
batchingOptions?: BatchingOptions<K, V, C>;
createProxyingResolver?: CreateProxyingResolverFn<TContext>;
- transforms: Array<Transform>;
+ transforms: Array<Transform<any, TContext>>;
transformedSchema: GraphQLSchema;
merge?: Record<string, MergedTypeConfig<any, any, TContext>>;
constructor(config: SubschemaConfig<K, V, C, TContext>);
diff --git a/./diff/old/dist/delegate/src/Transformer.d.ts b/./diff/new/dist/delegate/src/Transformer.d.ts
index 4302e22f..492963c7 100644
--- a/./diff/old/dist/delegate/src/Transformer.d.ts
+++ b/./diff/new/dist/delegate/src/Transformer.d.ts
@@ -1,9 +1,9 @@
import { Request, ExecutionResult } from '@graphql-tools/utils';
import { DelegationContext, DelegationBinding } from './types';
-export declare class Transformer {
+export declare class Transformer<TContext = Record<string, any>> {
private transformations;
private delegationContext;
- constructor(context: DelegationContext, binding?: DelegationBinding);
+ constructor(context: DelegationContext<TContext>, binding?: DelegationBinding<TContext>);
private addTransform;
transformRequest(originalRequest: Request): Request;
transformResult(originalResult: ExecutionResult): ExecutionResult<Record<string, any>>;
diff --git a/./diff/old/dist/delegate/src/applySchemaTransforms.d.ts b/./diff/new/dist/delegate/src/applySchemaTransforms.d.ts
index c2b6a220..2e505e88 100644
--- a/./diff/old/dist/delegate/src/applySchemaTransforms.d.ts
+++ b/./diff/new/dist/delegate/src/applySchemaTransforms.d.ts
@@ -1,3 +1,3 @@
import { GraphQLSchema } from 'graphql';
import { SubschemaConfig } from './types';
-export declare function applySchemaTransforms(originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig, transformedSchema?: GraphQLSchema): GraphQLSchema;
+export declare function applySchemaTransforms(originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig<any, any, any, any>, transformedSchema?: GraphQLSchema): GraphQLSchema;
diff --git a/./diff/old/dist/delegate/src/delegationBindings.d.ts b/./diff/new/dist/delegate/src/delegationBindings.d.ts
index baf66c8c..2ace9cd3 100644
--- a/./diff/old/dist/delegate/src/delegationBindings.d.ts
+++ b/./diff/new/dist/delegate/src/delegationBindings.d.ts
@@ -1,2 +1,2 @@
import { Transform, DelegationContext } from './types';
-export declare function defaultDelegationBinding(delegationContext: DelegationContext): Array<Transform>;
+export declare function defaultDelegationBinding<TContext>(delegationContext: DelegationContext<TContext>): Array<Transform<any, TContext>>;
diff --git a/./diff/old/dist/delegate/src/externalObjects.d.ts b/./diff/new/dist/delegate/src/externalObjects.d.ts
index 158f072b..cc8ab647 100644
--- a/./diff/old/dist/delegate/src/externalObjects.d.ts
+++ b/./diff/new/dist/delegate/src/externalObjects.d.ts
@@ -1,7 +1,7 @@
import { GraphQLSchema, GraphQLError, SelectionSetNode } from 'graphql';
import { SubschemaConfig, ExternalObject } from './types';
export declare function isExternalObject(data: any): data is ExternalObject;
-export declare function annotateExternalObject(object: any, errors: Array<GraphQLError>, subschema: GraphQLSchema | SubschemaConfig): ExternalObject;
+export declare function annotateExternalObject(object: any, errors: Array<GraphQLError>, subschema: GraphQLSchema | SubschemaConfig | undefined): ExternalObject;
export declare function getSubschema(object: ExternalObject, responseKey: string): GraphQLSchema | SubschemaConfig;
export declare function getUnpathedErrors(object: ExternalObject): Array<GraphQLError>;
export declare function mergeExternalObjects(schema: GraphQLSchema, path: Array<string | number>, typeName: string, target: ExternalObject, sources: Array<ExternalObject>, selectionSets: Array<SelectionSetNode>): ExternalObject;
diff --git a/./diff/old/dist/delegate/src/getFieldsNotInSubschema.d.ts b/./diff/new/dist/delegate/src/getFieldsNotInSubschema.d.ts
index 711c479b..6561899f 100644
--- a/./diff/old/dist/delegate/src/getFieldsNotInSubschema.d.ts
+++ b/./diff/new/dist/delegate/src/getFieldsNotInSubschema.d.ts
@@ -1,3 +1,3 @@
import { GraphQLSchema, FieldNode, GraphQLResolveInfo } from 'graphql';
import { MergedTypeInfo, SubschemaConfig } from './types';
-export declare const getFieldsNotInSubschema: (A1: GraphQLResolveInfo, A2: GraphQLSchema | SubschemaConfig<any, any, any, Record<string, any>>, A3: MergedTypeInfo<Record<string, any>>) => FieldNode[];
+export declare const getFieldsNotInSubschema: (A1: GraphQLResolveInfo, A2: GraphQLSchema | SubschemaConfig<any, any, any, any>, A3: MergedTypeInfo<Record<string, any>>) => FieldNode[];
diff --git a/./diff/old/dist/delegate/src/mergeFields.d.ts b/./diff/new/dist/delegate/src/mergeFields.d.ts
index 6a80b78c..c05276ff 100644
--- a/./diff/old/dist/delegate/src/mergeFields.d.ts
+++ b/./diff/new/dist/delegate/src/mergeFields.d.ts
@@ -1,4 +1,4 @@
import { FieldNode, GraphQLResolveInfo } from 'graphql';
import { MergedTypeInfo } from './types';
import { Subschema } from './Subschema';
-export declare function mergeFields(mergedTypeInfo: MergedTypeInfo, typeName: string, object: any, fieldNodes: Array<FieldNode>, sourceSubschemaOrSourceSubschemas: Subschema | Array<Subschema>, targetSubschemas: Array<Subschema>, context: Record<string, any>, info: GraphQLResolveInfo): any;
+export declare function mergeFields(mergedTypeInfo: MergedTypeInfo, typeName: string, object: any, fieldNodes: Array<FieldNode>, sourceSubschemaOrSourceSubschemas: Subschema<any, any, any, any> | Array<Subschema<any, any, any, any>>, targetSubschemas: Array<Subschema<any, any, any, any>>, context: any, info: GraphQLResolveInfo): any;
diff --git a/./diff/old/dist/delegate/src/subschemaConfig.d.ts b/./diff/new/dist/delegate/src/subschemaConfig.d.ts
index fa71ae7e..bf1ecece 100644
--- a/./diff/old/dist/delegate/src/subschemaConfig.d.ts
+++ b/./diff/new/dist/delegate/src/subschemaConfig.d.ts
@@ -1,3 +1,3 @@
import { SubschemaConfig } from './types';
-export declare function isSubschemaConfig(value: any): value is SubschemaConfig;
+export declare function isSubschemaConfig(value: any): value is SubschemaConfig<any, any, any, any>;
export declare function cloneSubschemaConfig(subschemaConfig: SubschemaConfig): SubschemaConfig;
diff --git a/./diff/old/dist/delegate/src/transforms/CheckResultAndHandleErrors.d.ts b/./diff/new/dist/delegate/src/transforms/CheckResultAndHandleErrors.d.ts
index 98488e8b..839c92dc 100644
--- a/./diff/old/dist/delegate/src/transforms/CheckResultAndHandleErrors.d.ts
+++ b/./diff/new/dist/delegate/src/transforms/CheckResultAndHandleErrors.d.ts
@@ -4,8 +4,8 @@ import { SubschemaConfig, Transform, DelegationContext } from '../types';
export default class CheckResultAndHandleErrors implements Transform {
transformResult(originalResult: ExecutionResult, delegationContext: DelegationContext, _transformationContext: Record<string, any>): ExecutionResult;
}
-export declare function checkResultAndHandleErrors(result: ExecutionResult, context: Record<string, any>, info: GraphQLResolveInfo, responseKey?: string, subschema?: GraphQLSchema | SubschemaConfig, returnType?: GraphQLOutputType, skipTypeMerging?: boolean, onLocatedError?: (originalError: GraphQLError) => GraphQLError): any;
-export declare function mergeDataAndErrors(data: any, errors: ReadonlyArray<GraphQLError>, path: Array<string | number>, onLocatedError: (originalError: GraphQLError) => GraphQLError, index?: number): {
+export declare function checkResultAndHandleErrors(result: ExecutionResult, context: Record<string, any>, info: GraphQLResolveInfo, responseKey: string | undefined, subschema: GraphQLSchema | SubschemaConfig, returnType?: GraphQLOutputType, skipTypeMerging?: boolean, onLocatedError?: (originalError: GraphQLError) => GraphQLError): any;
+export declare function mergeDataAndErrors(data: any, errors: ReadonlyArray<GraphQLError>, path: Array<string | number> | undefined, onLocatedError?: (originalError: GraphQLError) => GraphQLError, index?: number): {
data: any;
unpathedErrors: Array<GraphQLError>;
};
diff --git a/./diff/old/dist/delegate/src/transforms/VisitSelectionSets.d.ts b/./diff/new/dist/delegate/src/transforms/VisitSelectionSets.d.ts
index b56e8dc5..1486452e 100644
--- a/./diff/old/dist/delegate/src/transforms/VisitSelectionSets.d.ts
+++ b/./diff/new/dist/delegate/src/transforms/VisitSelectionSets.d.ts
@@ -1,8 +1,10 @@
import { SelectionSetNode, TypeInfo } from 'graphql';
-import { Request } from '@graphql-tools/utils';
+import { Request, Maybe } from '@graphql-tools/utils';
import { Transform, DelegationContext } from '../types';
+declare type VisitSelectionSetsVisitor = (node: SelectionSetNode, typeInfo: TypeInfo) => Maybe<SelectionSetNode>;
export default class VisitSelectionSets implements Transform {
private readonly visitor;
- constructor(visitor: (node: SelectionSetNode, typeInfo: TypeInfo) => SelectionSetNode);
+ constructor(visitor: VisitSelectionSetsVisitor);
transformRequest(originalRequest: Request, delegationContext: DelegationContext, _transformationContext: Record<string, any>): Request;
}
+export {};
diff --git a/./diff/old/dist/delegate/src/types.d.ts b/./diff/new/dist/delegate/src/types.d.ts
index 91db7fa7..25c51382 100644
--- a/./diff/old/dist/delegate/src/types.d.ts
+++ b/./diff/new/dist/delegate/src/types.d.ts
@@ -3,31 +3,31 @@ import DataLoader from 'dataloader';
import { ExecutionParams, ExecutionResult, Executor, Request, Subscriber, TypeMap } from '@graphql-tools/utils';
import { Subschema } from './Subschema';
import { OBJECT_SUBSCHEMA_SYMBOL, FIELD_SUBSCHEMA_MAP_SYMBOL, UNPATHED_ERRORS_SYMBOL } from './symbols';
-export declare type SchemaTransform = (originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig, transformedSchema?: GraphQLSchema) => GraphQLSchema;
+export declare type SchemaTransform<TContext = Record<any, string>> = (originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig<any, any, any, TContext>, transformedSchema?: GraphQLSchema) => GraphQLSchema;
export declare type RequestTransform<T = Record<string, any>> = (originalRequest: Request, delegationContext: DelegationContext, transformationContext: T) => Request;
export declare type ResultTransform<T = Record<string, any>> = (originalResult: ExecutionResult, delegationContext: DelegationContext, transformationContext: T) => ExecutionResult;
-export interface Transform<T = Record<string, any>> {
- transformSchema?: SchemaTransform;
+export interface Transform<T = any, TContext = Record<string, any>> {
+ transformSchema?: SchemaTransform<TContext>;
transformRequest?: RequestTransform<T>;
transformResult?: ResultTransform<T>;
}
-export interface DelegationContext {
- subschema: GraphQLSchema | SubschemaConfig;
- subschemaConfig: SubschemaConfig;
+export interface DelegationContext<TContext = Record<string, any>> {
+ subschema: GraphQLSchema | SubschemaConfig<any, any, any, TContext>;
+ subschemaConfig?: SubschemaConfig<any, any, any, TContext>;
targetSchema: GraphQLSchema;
operation: OperationTypeNode;
fieldName: string;
args: Record<string, any>;
- context: Record<string, any>;
+ context?: TContext;
info: GraphQLResolveInfo;
rootValue?: Record<string, any>;
returnType: GraphQLOutputType;
onLocatedError?: (originalError: GraphQLError) => GraphQLError;
- transforms: Array<Transform>;
+ transforms: Array<Transform<any, TContext>>;
transformedSchema: GraphQLSchema;
skipTypeMerging: boolean;
}
-export declare type DelegationBinding = (delegationContext: DelegationContext) => Array<Transform>;
+export declare type DelegationBinding<TContext = Record<string, any>> = (delegationContext: DelegationContext<TContext>) => Array<Transform<any, TContext>>;
export interface IDelegateToSchemaOptions<TContext = Record<string, any>, TArgs = Record<string, any>> {
schema: GraphQLSchema | SubschemaConfig<any, any, any, TContext>;
operationName?: string;
@@ -41,15 +41,14 @@ export interface IDelegateToSchemaOptions<TContext = Record<string, any>, TArgs
context?: TContext;
info: GraphQLResolveInfo;
rootValue?: Record<string, any>;
- transforms?: Array<Transform>;
+ transforms?: Array<Transform<any, TContext>>;
transformedSchema?: GraphQLSchema;
skipValidation?: boolean;
skipTypeMerging?: boolean;
- binding?: DelegationBinding;
+ binding?: DelegationBinding<TContext>;
}
-export interface IDelegateRequestOptions<TContext = Record<string, any>, TArgs = Record<string, any>> extends Omit<IDelegateToSchemaOptions<TContext, TArgs>, 'info'> {
+export interface IDelegateRequestOptions<TContext = Record<string, any>, TArgs = Record<string, any>> extends IDelegateToSchemaOptions<TContext, TArgs> {
request: Request;
- info?: GraphQLResolveInfo;
}
export interface ICreateRequestFromInfo {
info: GraphQLResolveInfo;
@@ -75,13 +74,13 @@ export interface ICreateRequest {
export interface MergedTypeInfo<TContext = Record<string, any>> {
typeName: string;
selectionSet?: SelectionSetNode;
- targetSubschemas: Map<Subschema, Array<Subschema>>;
- uniqueFields: Record<string, Subschema>;
- nonUniqueFields: Record<string, Array<Subschema>>;
- typeMaps: Map<GraphQLSchema | SubschemaConfig, TypeMap>;
- selectionSets: Map<Subschema, SelectionSetNode>;
- fieldSelectionSets: Map<Subschema, Record<string, SelectionSetNode>>;
- resolvers: Map<Subschema, MergedTypeResolver<TContext>>;
+ targetSubschemas: Map<Subschema<any, any, any, TContext>, Array<Subschema<any, any, any, TContext>>>;
+ uniqueFields: Record<string, Subschema<any, any, any, TContext>>;
+ nonUniqueFields: Record<string, Array<Subschema<any, any, any, TContext>>>;
+ typeMaps: Map<GraphQLSchema | SubschemaConfig<any, any, any, TContext>, TypeMap>;
+ selectionSets: Map<Subschema<any, any, any, TContext>, SelectionSetNode>;
+ fieldSelectionSets: Map<Subschema<any, any, any, TContext>, Record<string, SelectionSetNode>>;
+ resolvers: Map<Subschema<any, any, any, TContext>, MergedTypeResolver<TContext>>;
}
export interface ICreateProxyingResolverOptions<TContext = Record<string, any>> {
subschemaConfig: SubschemaConfig<any, any, any, TContext>;
@@ -97,7 +96,7 @@ export interface BatchingOptions<K = any, V = any, C = K> {
export interface SubschemaConfig<K = any, V = any, C = K, TContext = Record<string, any>> {
schema: GraphQLSchema;
createProxyingResolver?: CreateProxyingResolverFn<TContext>;
- transforms?: Array<Transform>;
+ transforms?: Array<Transform<any, TContext>>;
merge?: Record<string, MergedTypeConfig<any, any, TContext>>;
rootValue?: Record<string, any>;
executor?: Executor<TContext>;
@@ -132,9 +131,9 @@ export interface MergedFieldConfig {
export declare type MergedTypeResolver<TContext = Record<string, any>> = (originalResult: any, context: TContext, info: GraphQLResolveInfo, subschema: GraphQLSchema | SubschemaConfig<any, any, any, TContext>, selectionSet: SelectionSetNode, key?: any) => any;
export interface StitchingInfo<TContext = Record<string, any>> {
subschemaMap: Map<GraphQLSchema | SubschemaConfig<any, any, any, TContext>, Subschema<any, any, any, TContext>>;
- selectionSetsByType: Record<string, SelectionSetNode>;
+ selectionSetsByType: Record<string, SelectionSetNode> | undefined;
selectionSetsByField: Record<string, Record<string, SelectionSetNode>>;
- dynamicSelectionSetsByField: Record<string, Record<string, Array<(node: FieldNode) => SelectionSetNode>>>;
+ dynamicSelectionSetsByField: Record<string, Record<string, Array<(node: FieldNode) => SelectionSetNode>>> | undefined;
mergedTypes: Record<string, MergedTypeInfo<TContext>>;
}
export interface ExternalObject<TContext = Record<string, any>> {
diff --git a/./diff/old/dist/graphql-tag-pluck/src/visitor.d.ts b/./diff/new/dist/graphql-tag-pluck/src/visitor.d.ts
index a59d77ac..e5cc3cce 100644
--- a/./diff/old/dist/graphql-tag-pluck/src/visitor.d.ts
+++ b/./diff/new/dist/graphql-tag-pluck/src/visitor.d.ts
@@ -1,4 +1,5 @@
import { GraphQLTagPluckOptions } from '.';
+import { Visitor } from '@babel/traverse';
export declare type PluckedContent = {
content: string;
start: number;
@@ -14,22 +15,5 @@ export declare type PluckedContent = {
};
};
};
-declare const _default: (code: string, out: any, options?: GraphQLTagPluckOptions) => {
- CallExpression: {
- enter(path: any): void;
- };
- ImportDeclaration: {
- enter(path: any): void;
- };
- ExpressionStatement: {
- exit(path: any): void;
- };
- TemplateLiteral: {
- exit(path: any): void;
- };
- TaggedTemplateExpression: {
- exit(path: any): void;
- };
- exit(): void;
-};
+declare const _default: (code: string, out: any, options?: GraphQLTagPluckOptions) => Visitor<{}>;
export default _default;
diff --git a/./diff/old/dist/load/src/documents.d.ts b/./diff/new/dist/load/src/documents.d.ts
index 256807f9..b8a1c9b8 100644
--- a/./diff/old/dist/load/src/documents.d.ts
+++ b/./diff/new/dist/load/src/documents.d.ts
@@ -1,13 +1,15 @@
import { Source } from '@graphql-tools/utils';
+import { Kind } from 'graphql';
import { LoadTypedefsOptions, UnnormalizedTypeDefPointer } from './load-typedefs';
+declare type KindList = Array<typeof Kind[keyof typeof Kind]>;
/**
* Kinds of AST nodes that are included in executable documents
*/
-export declare const OPERATION_KINDS: ("FragmentDefinition" | "OperationDefinition")[];
+export declare const OPERATION_KINDS: KindList;
/**
* Kinds of AST nodes that are included in type system definition documents
*/
-export declare const NON_OPERATION_KINDS: any[];
+export declare const NON_OPERATION_KINDS: ("Document" | "ObjectTypeDefinition" | "UnionTypeDefinition" | "EnumTypeDefinition" | "InputObjectTypeDefinition" | "Name" | "OperationDefinition" | "VariableDefinition" | "SelectionSet" | "Field" | "Argument" | "FragmentSpread" | "InlineFragment" | "FragmentDefinition" | "Variable" | "IntValue" | "FloatValue" | "StringValue" | "BooleanValue" | "NullValue" | "EnumValue" | "ListValue" | "ObjectValue" | "ObjectField" | "Directive" | "NamedType" | "ListType" | "NonNullType" | "SchemaDefinition" | "OperationTypeDefinition" | "ScalarTypeDefinition" | "FieldDefinition" | "InputValueDefinition" | "InterfaceTypeDefinition" | "EnumValueDefinition" | "DirectiveDefinition" | "SchemaExtension" | "ScalarTypeExtension" | "ObjectTypeExtension" | "InterfaceTypeExtension" | "UnionTypeExtension" | "EnumTypeExtension" | "InputObjectTypeExtension")[];
/**
* Asynchronously loads executable documents (i.e. operations and fragments) from
* the provided pointers. The pointers may be individual files or a glob pattern.
@@ -26,3 +28,4 @@ export declare function loadDocuments(pointerOrPointers: UnnormalizedTypeDefPoin
* @param options Additional options
*/
export declare function loadDocumentsSync(pointerOrPointers: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[], options: LoadTypedefsOptions): Source[];
+export {};
diff --git a/./diff/old/dist/load/src/filter-document-kind.d.ts b/./diff/new/dist/load/src/filter-document-kind.d.ts
index 94fc11b3..479ac44f 100644
--- a/./diff/old/dist/load/src/filter-document-kind.d.ts
+++ b/./diff/new/dist/load/src/filter-document-kind.d.ts
@@ -2,4 +2,4 @@ import { DocumentNode } from 'graphql';
/**
* @internal
*/
-export declare const filterKind: (content: DocumentNode, filterKinds: null | string[]) => DocumentNode;
+export declare const filterKind: (content: DocumentNode | undefined, filterKinds: null | string[]) => DocumentNode | undefined;
diff --git a/./diff/old/dist/load/src/load-typedefs/load-file.d.ts b/./diff/new/dist/load/src/load-typedefs/load-file.d.ts
index 259adff4..df6e0842 100644
--- a/./diff/old/dist/load/src/load-typedefs/load-file.d.ts
+++ b/./diff/new/dist/load/src/load-typedefs/load-file.d.ts
@@ -1,4 +1,4 @@
-import { Source } from '@graphql-tools/utils';
+import { Source, Maybe } from '@graphql-tools/utils';
import { LoadTypedefsOptions } from '../load-typedefs';
-export declare function loadFile(pointer: string, options: LoadTypedefsOptions): Promise<Source>;
-export declare function loadFileSync(pointer: string, options: LoadTypedefsOptions): Source;
+export declare function loadFile(pointer: string, options: LoadTypedefsOptions): Promise<Maybe<Source>>;
+export declare function loadFileSync(pointer: string, options: LoadTypedefsOptions): Maybe<Source>;
diff --git a/./diff/old/dist/load/src/load-typedefs/parse.d.ts b/./diff/new/dist/load/src/load-typedefs/parse.d.ts
index 0a2cf35f..799383d1 100644
--- a/./diff/old/dist/load/src/load-typedefs/parse.d.ts
+++ b/./diff/new/dist/load/src/load-typedefs/parse.d.ts
@@ -1,7 +1,7 @@
import { Source } from '@graphql-tools/utils';
declare type AddValidSource = (source: Source) => void;
declare type ParseOptions = {
- partialSource: Partial<Source>;
+ partialSource: Source;
options: any;
globOptions: any;
pointerOptionMap: any;
diff --git a/./diff/old/dist/loaders/code-file/src/exports.d.ts b/./diff/new/dist/loaders/code-file/src/exports.d.ts
index ca806cd2..ea052923 100644
--- a/./diff/old/dist/loaders/code-file/src/exports.d.ts
+++ b/./diff/new/dist/loaders/code-file/src/exports.d.ts
@@ -5,11 +5,11 @@ import { DocumentNode, GraphQLSchema } from 'graphql';
export declare function pickExportFromModule({ module, filepath }: {
module: any;
filepath: string;
-}): Promise<GraphQLSchema | DocumentNode>;
+}): Promise<DocumentNode | GraphQLSchema | null>;
/**
* @internal
*/
export declare function pickExportFromModuleSync({ module, filepath }: {
module: any;
filepath: string;
-}): GraphQLSchema | DocumentNode;
+}): DocumentNode | GraphQLSchema | null;
diff --git a/./diff/old/dist/loaders/code-file/src/index.d.ts b/./diff/new/dist/loaders/code-file/src/index.d.ts
index 785534d3..0eac83fa 100644
--- a/./diff/old/dist/loaders/code-file/src/index.d.ts
+++ b/./diff/new/dist/loaders/code-file/src/index.d.ts
@@ -29,6 +29,6 @@ export declare class CodeFileLoader implements UniversalLoader<CodeFileLoaderOpt
canLoadSync(pointer: SchemaPointerSingle | DocumentPointerSingle, options: CodeFileLoaderOptions): boolean;
resolveGlobs({ globs, ignores }: ResolverGlobs, options: CodeFileLoaderOptions): Promise<string[]>;
resolveGlobsSync({ globs, ignores }: ResolverGlobs, options: CodeFileLoaderOptions): string[];
- load(pointer: SchemaPointerSingle | DocumentPointerSingle, options: CodeFileLoaderOptions): Promise<Source>;
- loadSync(pointer: SchemaPointerSingle | DocumentPointerSingle, options: CodeFileLoaderOptions): Source;
+ load(pointer: SchemaPointerSingle | DocumentPointerSingle, options: CodeFileLoaderOptions): Promise<Source | null>;
+ loadSync(pointer: SchemaPointerSingle | DocumentPointerSingle, options: CodeFileLoaderOptions): Source | null;
}
diff --git a/./diff/old/dist/loaders/code-file/src/load-from-module.d.ts b/./diff/new/dist/loaders/code-file/src/load-from-module.d.ts
index c49c303c..ed69c1ff 100644
--- a/./diff/old/dist/loaders/code-file/src/load-from-module.d.ts
+++ b/./diff/new/dist/loaders/code-file/src/load-from-module.d.ts
@@ -2,8 +2,8 @@ import { DocumentNode, GraphQLSchema } from 'graphql';
/**
* @internal
*/
-export declare function tryToLoadFromExport(rawFilePath: string): Promise<GraphQLSchema | DocumentNode>;
+export declare function tryToLoadFromExport(rawFilePath: string): Promise<GraphQLSchema | DocumentNode | null>;
/**
* @internal
*/
-export declare function tryToLoadFromExportSync(rawFilePath: string): GraphQLSchema | DocumentNode;
+export declare function tryToLoadFromExportSync(rawFilePath: string): GraphQLSchema | DocumentNode | null;
diff --git a/./diff/old/dist/loaders/github/src/index.d.ts b/./diff/new/dist/loaders/github/src/index.d.ts
index a6da581a..f1955489 100644
--- a/./diff/old/dist/loaders/github/src/index.d.ts
+++ b/./diff/new/dist/loaders/github/src/index.d.ts
@@ -27,9 +27,9 @@ export declare class GithubLoader implements UniversalLoader<GithubLoaderOptions
loaderId(): string;
canLoad(pointer: string): Promise<boolean>;
canLoadSync(): boolean;
- load(pointer: string, options: GithubLoaderOptions): Promise<{
- location: string;
+ load(pointer: string, options: GithubLoaderOptions): Promise<import("@graphql-tools/utils").Source | {
+ location: string | undefined;
document: import("graphql").DocumentNode;
- } | import("@graphql-tools/utils").Source>;
+ }>;
loadSync(): never;
}
diff --git a/./diff/old/dist/loaders/graphql-file/src/index.d.ts b/./diff/new/dist/loaders/graphql-file/src/index.d.ts
index 4a87c4c5..f76b1d95 100644
--- a/./diff/old/dist/loaders/graphql-file/src/index.d.ts
+++ b/./diff/new/dist/loaders/graphql-file/src/index.d.ts
@@ -40,7 +40,7 @@ export declare class GraphQLFileLoader implements UniversalLoader<GraphQLFileLoa
load(pointer: SchemaPointerSingle | DocumentPointerSingle, options: GraphQLFileLoaderOptions): Promise<Source>;
loadSync(pointer: SchemaPointerSingle | DocumentPointerSingle, options: GraphQLFileLoaderOptions): Source;
handleFileContent(rawSDL: string, pointer: string, options: GraphQLFileLoaderOptions): {
- location: string;
+ location: string | undefined;
document: import("graphql").DocumentNode;
};
}
diff --git a/./diff/old/dist/loaders/prisma/src/prisma-yml/Cluster.d.ts b/./diff/new/dist/loaders/prisma/src/prisma-yml/Cluster.d.ts
index 3d60890b..57e5fb66 100644
--- a/./diff/old/dist/loaders/prisma/src/prisma-yml/Cluster.d.ts
+++ b/./diff/new/dist/loaders/prisma/src/prisma-yml/Cluster.d.ts
@@ -7,7 +7,7 @@ export declare class Cluster {
local: boolean;
shared: boolean;
clusterSecret?: string;
- requiresAuth: boolean;
+ requiresAuth: boolean | undefined;
out: IOutput;
isPrivate: boolean;
workspaceSlug?: string;
@@ -33,9 +33,9 @@ export declare class Cluster {
name: string;
baseUrl: string;
local: boolean;
- clusterSecret: string;
+ clusterSecret: string | undefined;
shared: boolean;
isPrivate: boolean;
- workspaceSlug: string;
+ workspaceSlug: string | undefined;
};
}
diff --git a/./diff/old/dist/loaders/prisma/src/prisma-yml/Environment.d.ts b/./diff/new/dist/loaders/prisma/src/prisma-yml/Environment.d.ts
index 6277457a..7a15a65d 100644
--- a/./diff/old/dist/loaders/prisma/src/prisma-yml/Environment.d.ts
+++ b/./diff/new/dist/loaders/prisma/src/prisma-yml/Environment.d.ts
@@ -8,16 +8,17 @@ export declare class Environment {
clusterEndpointMap: {
[key: string]: string;
};
- args: Args;
- activeCluster: Cluster;
+ args: Args | undefined;
+ activeCluster: Cluster | undefined;
globalRC: RC;
- clusters: Cluster[];
+ clusters: Cluster[] | undefined;
out: IOutput;
home: string;
rcPath: string;
clustersFetched: boolean;
version?: string;
constructor(home: string, out?: IOutput, version?: string);
+ private _getClusters;
load(): Promise<void>;
get cloudSessionKey(): string | undefined;
renewToken(): Promise<void>;
diff --git a/./diff/old/dist/loaders/prisma/src/prisma-yml/PrismaDefinition.d.ts b/./diff/new/dist/loaders/prisma/src/prisma-yml/PrismaDefinition.d.ts
index 2f7b2672..d2ae0da6 100644
--- a/./diff/old/dist/loaders/prisma/src/prisma-yml/PrismaDefinition.d.ts
+++ b/./diff/new/dist/loaders/prisma/src/prisma-yml/PrismaDefinition.d.ts
@@ -15,7 +15,7 @@ export declare class PrismaDefinitionClass {
typesString?: string;
secrets: string[] | null;
definitionPath?: string | null;
- definitionDir: string;
+ definitionDir: string | undefined;
env: Environment;
out?: IOutput;
envVars: any;
@@ -32,7 +32,7 @@ export declare class PrismaDefinitionClass {
validate(): void;
getToken(serviceName: string, stageName: string): string | undefined;
getCluster(_?: boolean): Promise<Cluster | undefined>;
- findClusterByBaseUrl(baseUrl: string): Cluster;
+ findClusterByBaseUrl(baseUrl: string): Cluster | undefined;
getClusterByEndpoint(data: ParseEndpointResult): Promise<Cluster>;
getTypesString(definition: PrismaDefinition): string;
getClusterName(): string | null;
@@ -41,7 +41,7 @@ export declare class PrismaDefinitionClass {
getSubscriptions(): FunctionInput[];
replaceEndpoint(newEndpoint: any): void;
addDatamodel(datamodel: any): void;
- getEndpoint(serviceInput?: string, stageInput?: string): Promise<string>;
+ getEndpoint(serviceInput?: string, stageInput?: string): Promise<string | null>;
getHooks(hookType: HookType): string[];
}
export declare function concatName(cluster: Cluster, name: string, workspace: string | null): string;
diff --git a/./diff/old/dist/loaders/url/src/index.d.ts b/./diff/new/dist/loaders/url/src/index.d.ts
index 26007d3f..cc1bd11b 100644
--- a/./diff/old/dist/loaders/url/src/index.d.ts
+++ b/./diff/new/dist/loaders/url/src/index.d.ts
@@ -1,7 +1,7 @@
/// <reference types="ws" />
/// <reference lib="dom" />
import { IntrospectionOptions } from 'graphql';
-import { AsyncExecutor, Subscriber, SyncExecutor, SchemaPointerSingle, Source, DocumentLoader, SingleFileOptions, ExecutionParams } from '@graphql-tools/utils';
+import { AsyncExecutor, Subscriber, SyncExecutor, SchemaPointerSingle, Source, DocumentLoader, SingleFileOptions, ExecutionParams, Maybe } from '@graphql-tools/utils';
import { SubschemaConfig } from '@graphql-tools/delegate';
import { ClientOptions } from 'graphql-ws';
import WebSocket from 'isomorphic-ws';
@@ -19,10 +19,10 @@ declare type Headers = Record<string, string> | Array<Record<string, string>> |
declare type BuildExecutorOptions<TFetchFn = FetchFn> = {
pointer: string;
fetch: TFetchFn;
- extraHeaders: Headers;
+ extraHeaders?: Maybe<Headers>;
defaultMethod: 'GET' | 'POST';
- useGETForQueries: boolean;
- multipart?: boolean;
+ useGETForQueries?: Maybe<boolean>;
+ multipart?: Maybe<boolean>;
};
export declare type AsyncImportFn<T = unknown> = (moduleName: string) => PromiseLike<T>;
export declare type SyncImportFn<T = unknown> = (moduleName: string) => T;
@@ -107,7 +107,7 @@ export declare class UrlLoader implements DocumentLoader<LoadFromUrlOptions> {
buildExecutor(options: BuildExecutorOptions<AsyncFetchFn>): AsyncExecutor;
buildWSSubscriber(subscriptionsEndpoint: string, webSocketImpl: typeof WebSocket, connectionParams?: ClientOptions['connectionParams']): Subscriber;
buildWSLegacySubscriber(subscriptionsEndpoint: string, webSocketImpl: typeof WebSocket, connectionParams?: ConnectionParamsOptions): Subscriber;
- buildSSESubscriber(pointer: string, extraHeaders: Headers, fetch: AsyncFetchFn, options: FetchEventSourceInit): Subscriber;
+ buildSSESubscriber(pointer: string, extraHeaders: Maybe<Headers>, fetch: AsyncFetchFn, options: Maybe<FetchEventSourceInit>): Subscriber;
getFetch(customFetch: LoadFromUrlOptions['customFetch'], importFn: AsyncImportFn, async: true): PromiseLike<AsyncFetchFn>;
getFetch(customFetch: LoadFromUrlOptions['customFetch'], importFn: SyncImportFn, async: false): SyncFetchFn;
private getHeadersFromOptions;
diff --git a/./diff/old/dist/merge/src/merge-resolvers.d.ts b/./diff/new/dist/merge/src/merge-resolvers.d.ts
index b6b1b07f..aea0ec81 100644
--- a/./diff/old/dist/merge/src/merge-resolvers.d.ts
+++ b/./diff/new/dist/merge/src/merge-resolvers.d.ts
@@ -1,4 +1,4 @@
-import { IResolvers } from '@graphql-tools/utils';
+import { IResolvers, Maybe } from '@graphql-tools/utils';
export declare type ResolversFactory<TContext> = (...args: any[]) => IResolvers<any, TContext>;
export declare type ResolversDefinition<TContext> = IResolvers<any, TContext> | ResolversFactory<TContext>;
/**
@@ -36,4 +36,4 @@ export interface MergeResolversOptions {
* const resolvers = mergeResolvers(resolversArray)
* ```
*/
-export declare function mergeResolvers<TContext, T extends ResolversDefinition<TContext>>(resolversDefinitions: T[], options?: MergeResolversOptions): T;
+export declare function mergeResolvers<TContext, T extends ResolversDefinition<TContext>>(resolversDefinitions: Maybe<T[]>, options?: MergeResolversOptions): T;
diff --git a/./diff/old/dist/merge/src/typedefs-mergers/arguments.d.ts b/./diff/new/dist/merge/src/typedefs-mergers/arguments.d.ts
index 64d81b20..d6633aa5 100644
--- a/./diff/old/dist/merge/src/typedefs-mergers/arguments.d.ts
+++ b/./diff/new/dist/merge/src/typedefs-mergers/arguments.d.ts
@@ -1,3 +1,3 @@
import { InputValueDefinitionNode } from 'graphql';
import { Config } from '.';
-export declare function mergeArguments(args1: InputValueDefinitionNode[], args2: InputValueDefinitionNode[], config: Config): InputValueDefinitionNode[];
+export declare function mergeArguments(args1: InputValueDefinitionNode[], args2: InputValueDefinitionNode[], config?: Config): InputValueDefinitionNode[];
diff --git a/./diff/old/dist/merge/src/typedefs-mergers/enum-values.d.ts b/./diff/new/dist/merge/src/typedefs-mergers/enum-values.d.ts
index 6fdcb21a..bb7fecd4 100644
--- a/./diff/old/dist/merge/src/typedefs-mergers/enum-values.d.ts
+++ b/./diff/new/dist/merge/src/typedefs-mergers/enum-values.d.ts
@@ -1,3 +1,3 @@
import { EnumValueDefinitionNode } from 'graphql';
import { Config } from './merge-typedefs';
-export declare function mergeEnumValues(first: ReadonlyArray<EnumValueDefinitionNode>, second: ReadonlyArray<EnumValueDefinitionNode>, config?: Config): EnumValueDefinitionNode[];
+export declare function mergeEnumValues(first: ReadonlyArray<EnumValueDefinitionNode> | undefined, second: ReadonlyArray<EnumValueDefinitionNode> | undefined, config?: Config): EnumValueDefinitionNode[];
diff --git a/./diff/old/dist/merge/src/typedefs-mergers/fields.d.ts b/./diff/new/dist/merge/src/typedefs-mergers/fields.d.ts
index 945062a0..5c1ae1ca 100644
--- a/./diff/old/dist/merge/src/typedefs-mergers/fields.d.ts
+++ b/./diff/new/dist/merge/src/typedefs-mergers/fields.d.ts
@@ -2,4 +2,4 @@ import { Config } from './merge-typedefs';
import { FieldDefinitionNode, InputValueDefinitionNode, NameNode } from 'graphql';
export declare function mergeFields<T extends FieldDefinitionNode | InputValueDefinitionNode>(type: {
name: NameNode;
-}, f1: ReadonlyArray<T>, f2: ReadonlyArray<T>, config?: Config): T[];
+}, f1: ReadonlyArray<T> | undefined, f2: ReadonlyArray<T> | undefined, config?: Config): T[];
diff --git a/./diff/old/dist/merge/src/typedefs-mergers/interface.d.ts b/./diff/new/dist/merge/src/typedefs-mergers/interface.d.ts
index 407a6c92..4667ff1a 100644
--- a/./diff/old/dist/merge/src/typedefs-mergers/interface.d.ts
+++ b/./diff/new/dist/merge/src/typedefs-mergers/interface.d.ts
@@ -1,3 +1,3 @@
import { Config } from './merge-typedefs';
import { InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode } from 'graphql';
-export declare function mergeInterface(node: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode, existingNode: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode, config: Config): InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode;
+export declare function mergeInterface(node: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode, existingNode: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode, config?: Config): InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode;
diff --git a/./diff/old/dist/merge/src/typedefs-mergers/merge-nodes.d.ts b/./diff/new/dist/merge/src/typedefs-mergers/merge-nodes.d.ts
index 60d05d68..14ba2c0e 100644
--- a/./diff/old/dist/merge/src/typedefs-mergers/merge-nodes.d.ts
+++ b/./diff/new/dist/merge/src/typedefs-mergers/merge-nodes.d.ts
@@ -1,5 +1,6 @@
import { Config } from './merge-typedefs';
import { DefinitionNode, NameNode, SchemaDefinitionNode, SchemaExtensionNode } from 'graphql';
+export declare const schemaDefSymbol = "SCHEMA_DEF_SYMBOL";
export declare type MergedResultMap = Record<string, NamedDefinitionNode> & {
[schemaDefSymbol]: SchemaDefinitionNode | SchemaExtensionNode;
};
@@ -7,5 +8,4 @@ export declare type NamedDefinitionNode = DefinitionNode & {
name?: NameNode;
};
export declare function isNamedDefinitionNode(definitionNode: DefinitionNode): definitionNode is NamedDefinitionNode;
-export declare const schemaDefSymbol = "SCHEMA_DEF_SYMBOL";
export declare function mergeGraphQLNodes(nodes: ReadonlyArray<DefinitionNode>, config?: Config): MergedResultMap;
diff --git a/./diff/old/dist/merge/src/typedefs-mergers/utils.d.ts b/./diff/new/dist/merge/src/typedefs-mergers/utils.d.ts
index 51938802..1265b096 100644
--- a/./diff/old/dist/merge/src/typedefs-mergers/utils.d.ts
+++ b/./diff/new/dist/merge/src/typedefs-mergers/utils.d.ts
@@ -11,5 +11,5 @@ export declare enum CompareVal {
A_EQUALS_B = 0,
A_GREATER_THAN_B = 1
}
-export declare type CompareFn<T> = (a: T, b: T) => -1 | 0 | 1;
-export declare function defaultStringComparator(a: string, b: string): CompareVal;
+export declare type CompareFn<T> = (a: T | undefined, b: T | undefined) => -1 | 0 | 1;
+export declare function defaultStringComparator(a: string | undefined, b: string | undefined): CompareVal;
diff --git a/./diff/old/dist/schema/src/chainResolvers.d.ts b/./diff/new/dist/schema/src/chainResolvers.d.ts
index 865a240d..cfeb6c41 100644
--- a/./diff/old/dist/schema/src/chainResolvers.d.ts
+++ b/./diff/new/dist/schema/src/chainResolvers.d.ts
@@ -1,4 +1,5 @@
import { GraphQLResolveInfo, GraphQLFieldResolver } from 'graphql';
-export declare function chainResolvers(resolvers: Array<GraphQLFieldResolver<any, any>>): (root: any, args: {
+import { Maybe } from '@graphql-tools/utils';
+export declare function chainResolvers<TArgs extends {
[argName: string]: any;
-}, ctx: any, info: GraphQLResolveInfo) => any;
+}>(resolvers: Array<Maybe<GraphQLFieldResolver<any, any, TArgs>>>): (root: any, args: TArgs, ctx: any, info: GraphQLResolveInfo) => any;
diff --git a/./diff/old/dist/schema/src/checkForResolveTypeResolver.d.ts b/./diff/new/dist/schema/src/checkForResolveTypeResolver.d.ts
index 8b291ae0..86452581 100644
--- a/./diff/old/dist/schema/src/checkForResolveTypeResolver.d.ts
+++ b/./diff/new/dist/schema/src/checkForResolveTypeResolver.d.ts
@@ -1,3 +1,3 @@
import { GraphQLSchema } from 'graphql';
import { ValidatorBehavior } from '@graphql-tools/utils';
-export declare function checkForResolveTypeResolver(schema: GraphQLSchema, requireResolversForResolveType: ValidatorBehavior): void;
+export declare function checkForResolveTypeResolver(schema: GraphQLSchema, requireResolversForResolveType?: ValidatorBehavior): void;
diff --git a/./diff/old/dist/schema/src/decorateWithLogger.d.ts b/./diff/new/dist/schema/src/decorateWithLogger.d.ts
index a38e545c..7fff8071 100644
--- a/./diff/old/dist/schema/src/decorateWithLogger.d.ts
+++ b/./diff/new/dist/schema/src/decorateWithLogger.d.ts
@@ -1,3 +1,4 @@
import { GraphQLFieldResolver } from 'graphql';
+import { Maybe } from 'packages/graphql-tools/src';
import { ILogger } from './types';
-export declare function decorateWithLogger(fn: GraphQLFieldResolver<any, any>, logger: ILogger, hint: string): GraphQLFieldResolver<any, any>;
+export declare function decorateWithLogger(fn: Maybe<GraphQLFieldResolver<any, any>>, logger: ILogger, hint: string): GraphQLFieldResolver<any, any>;
diff --git a/./diff/old/dist/schema/src/extensionDefinitions.d.ts b/./diff/new/dist/schema/src/extensionDefinitions.d.ts
index 572b2bf6..35ceefd5 100644
--- a/./diff/old/dist/schema/src/extensionDefinitions.d.ts
+++ b/./diff/new/dist/schema/src/extensionDefinitions.d.ts
@@ -3,21 +3,21 @@ export declare function filterAndExtractExtensionDefinitions(ast: DocumentNode):
typesAst: {
definitions: DefinitionNode[];
kind: "Document";
- loc?: import("graphql").Location;
+ loc?: import("graphql").Location | undefined;
};
extensionsAst: {
definitions: DefinitionNode[];
kind: "Document";
- loc?: import("graphql").Location;
+ loc?: import("graphql").Location | undefined;
};
};
export declare function filterExtensionDefinitions(ast: DocumentNode): {
definitions: DefinitionNode[];
kind: "Document";
- loc?: import("graphql").Location;
+ loc?: import("graphql").Location | undefined;
};
export declare function extractExtensionDefinitions(ast: DocumentNode): {
definitions: DefinitionNode[];
kind: "Document";
- loc?: import("graphql").Location;
+ loc?: import("graphql").Location | undefined;
};
diff --git a/./diff/old/dist/stitch/src/createMergedTypeResolver.d.ts b/./diff/new/dist/stitch/src/createMergedTypeResolver.d.ts
index e9d5bfce..db5ce6cd 100644
--- a/./diff/old/dist/stitch/src/createMergedTypeResolver.d.ts
+++ b/./diff/new/dist/stitch/src/createMergedTypeResolver.d.ts
@@ -1,2 +1,2 @@
import { MergedTypeResolver, MergedTypeResolverOptions } from '@graphql-tools/delegate';
-export declare function createMergedTypeResolver(mergedTypeResolverOptions: MergedTypeResolverOptions): MergedTypeResolver;
+export declare function createMergedTypeResolver(mergedTypeResolverOptions: MergedTypeResolverOptions): MergedTypeResolver | undefined;
diff --git a/./diff/old/dist/stitch/src/mergeCandidates.d.ts b/./diff/new/dist/stitch/src/mergeCandidates.d.ts
index ca50c323..00a28b8d 100644
--- a/./diff/old/dist/stitch/src/mergeCandidates.d.ts
+++ b/./diff/new/dist/stitch/src/mergeCandidates.d.ts
@@ -1,3 +1,3 @@
import { GraphQLNamedType } from 'graphql';
import { MergeTypeCandidate, TypeMergingOptions } from './types';
-export declare function mergeCandidates(typeName: string, candidates: Array<MergeTypeCandidate>, typeMergingOptions: TypeMergingOptions): GraphQLNamedType;
+export declare function mergeCandidates<TContext = Record<string, any>>(typeName: string, candidates: Array<MergeTypeCandidate<TContext>>, typeMergingOptions?: TypeMergingOptions<TContext>): GraphQLNamedType;
diff --git a/./diff/old/dist/stitch/src/mergeValidations.d.ts b/./diff/new/dist/stitch/src/mergeValidations.d.ts
index cf4cc621..6cdc514e 100644
--- a/./diff/old/dist/stitch/src/mergeValidations.d.ts
+++ b/./diff/new/dist/stitch/src/mergeValidations.d.ts
@@ -1,7 +1,7 @@
import { GraphQLFieldConfig, GraphQLInputFieldConfig, GraphQLArgumentConfig, GraphQLEnumType } from 'graphql';
import { MergeTypeCandidate, MergeFieldConfigCandidate, MergeInputFieldConfigCandidate, TypeMergingOptions } from './types';
-export declare function validateFieldConsistency(finalFieldConfig: GraphQLFieldConfig<any, any>, candidates: Array<MergeFieldConfigCandidate>, typeMergingOptions: TypeMergingOptions): void;
-export declare function validateInputObjectConsistency(fieldInclusionMap: Record<string, number>, candidates: Array<MergeTypeCandidate>, typeMergingOptions: TypeMergingOptions): void;
-export declare function validateInputFieldConsistency(finalInputFieldConfig: GraphQLInputFieldConfig, candidates: Array<MergeInputFieldConfigCandidate>, typeMergingOptions: TypeMergingOptions): void;
-export declare function validateTypeConsistency(finalElementConfig: GraphQLFieldConfig<any, any> | GraphQLArgumentConfig | GraphQLInputFieldConfig, candidates: Array<GraphQLFieldConfig<any, any> | GraphQLArgumentConfig | GraphQLInputFieldConfig>, definitionType: string, settingNamespace: string, typeMergingOptions: TypeMergingOptions): void;
-export declare function validateInputEnumConsistency(inputEnumType: GraphQLEnumType, candidates: Array<GraphQLArgumentConfig | GraphQLInputFieldConfig>, typeMergingOptions: TypeMergingOptions): void;
+export declare function validateFieldConsistency<TContext = Record<string, any>>(finalFieldConfig: GraphQLFieldConfig<any, any>, candidates: Array<MergeFieldConfigCandidate<TContext>>, typeMergingOptions?: TypeMergingOptions<TContext>): void;
+export declare function validateInputObjectConsistency<TContext = Record<string, any>>(fieldInclusionMap: Record<string, number>, candidates: Array<MergeTypeCandidate<TContext>>, typeMergingOptions?: TypeMergingOptions<TContext>): void;
+export declare function validateInputFieldConsistency<TContext = Record<string, any>>(finalInputFieldConfig: GraphQLInputFieldConfig, candidates: Array<MergeInputFieldConfigCandidate<TContext>>, typeMergingOptions?: TypeMergingOptions<TContext>): void;
+export declare function validateTypeConsistency<TContext = Record<string, any>>(finalElementConfig: GraphQLFieldConfig<any, any> | GraphQLArgumentConfig | GraphQLInputFieldConfig, candidates: Array<GraphQLFieldConfig<any, any> | GraphQLArgumentConfig | GraphQLInputFieldConfig>, definitionType: string, settingNamespace: string, typeMergingOptions?: TypeMergingOptions<TContext>): void;
+export declare function validateInputEnumConsistency<TContext = Record<string, any>>(inputEnumType: GraphQLEnumType, candidates: Array<GraphQLArgumentConfig | GraphQLInputFieldConfig>, typeMergingOptions?: TypeMergingOptions<TContext>): void;
diff --git a/./diff/old/dist/stitch/src/stitchingInfo.d.ts b/./diff/new/dist/stitch/src/stitchingInfo.d.ts
index f4c3b37f..8981a576 100644
--- a/./diff/old/dist/stitch/src/stitchingInfo.d.ts
+++ b/./diff/new/dist/stitch/src/stitchingInfo.d.ts
@@ -2,7 +2,7 @@ import { GraphQLSchema, SelectionSetNode } from 'graphql';
import { IResolvers } from '@graphql-tools/utils';
import { Subschema, SubschemaConfig, StitchingInfo } from '@graphql-tools/delegate';
import { MergeTypeCandidate, MergeTypeFilter } from './types';
-export declare function createStitchingInfo(subschemaMap: Map<GraphQLSchema | SubschemaConfig, Subschema>, typeCandidates: Record<string, Array<MergeTypeCandidate>>, mergeTypes?: boolean | Array<string> | MergeTypeFilter): StitchingInfo;
-export declare function completeStitchingInfo(stitchingInfo: StitchingInfo, resolvers: IResolvers, schema: GraphQLSchema): StitchingInfo;
-export declare function addStitchingInfo(stitchedSchema: GraphQLSchema, stitchingInfo: StitchingInfo): GraphQLSchema;
+export declare function createStitchingInfo<TContext = Record<string, any>>(subschemaMap: Map<GraphQLSchema | SubschemaConfig<any, any, any, TContext>, Subschema<any, any, any, TContext>>, typeCandidates: Record<string, Array<MergeTypeCandidate<TContext>>>, mergeTypes?: boolean | Array<string> | MergeTypeFilter<TContext>): StitchingInfo<TContext>;
+export declare function completeStitchingInfo<TContext = Record<string, any>>(stitchingInfo: StitchingInfo<TContext>, resolvers: IResolvers, schema: GraphQLSchema): StitchingInfo<TContext>;
+export declare function addStitchingInfo<TContext = Record<string, any>>(stitchedSchema: GraphQLSchema, stitchingInfo: StitchingInfo<TContext>): GraphQLSchema;
export declare function selectionSetContainsTopLevelField(selectionSet: SelectionSetNode, fieldName: string): boolean;
diff --git a/./diff/old/dist/stitch/src/subschemaConfigTransforms/index.d.ts b/./diff/new/dist/stitch/src/subschemaConfigTransforms/index.d.ts
index 05739040..25a5c521 100644
--- a/./diff/old/dist/stitch/src/subschemaConfigTransforms/index.d.ts
+++ b/./diff/new/dist/stitch/src/subschemaConfigTransforms/index.d.ts
@@ -1,4 +1,5 @@
+import { SubschemaConfigTransform } from 'packages/graphql-tools/src';
export { computedDirectiveTransformer } from './computedDirectiveTransformer';
export { isolateComputedFieldsTransformer } from './isolateComputedFieldsTransformer';
export { splitMergedTypeEntryPointsTransformer } from './splitMergedTypeEntryPointsTransformer';
-export declare const defaultSubschemaConfigTransforms: import("..").SubschemaConfigTransform<Record<string, any>>[];
+export declare const defaultSubschemaConfigTransforms: Array<SubschemaConfigTransform<any>>;
diff --git a/./diff/old/dist/stitch/src/typeCandidates.d.ts b/./diff/new/dist/stitch/src/typeCandidates.d.ts
index f7fac58f..31660587 100644
--- a/./diff/old/dist/stitch/src/typeCandidates.d.ts
+++ b/./diff/new/dist/stitch/src/typeCandidates.d.ts
@@ -2,11 +2,11 @@ import { DocumentNode, GraphQLNamedType, GraphQLDirective, SchemaDefinitionNode,
import { Subschema, SubschemaConfig, StitchingInfo } from '@graphql-tools/delegate';
import { GraphQLParseOptions, ITypeDefinitions, TypeMap } from '@graphql-tools/utils';
import { MergeTypeCandidate, MergeTypeFilter, OnTypeConflict, TypeMergingOptions } from './types';
-export declare function buildTypeCandidates({ subschemas, originalSubschemaMap, types, typeDefs, parseOptions, extensions, directiveMap, schemaDefs, operationTypeNames, mergeDirectives, }: {
- subschemas: Array<Subschema>;
- originalSubschemaMap: Map<Subschema, GraphQLSchema | SubschemaConfig>;
+export declare function buildTypeCandidates<TContext = Record<string, any>>({ subschemas, originalSubschemaMap, types, typeDefs, parseOptions, extensions, directiveMap, schemaDefs, operationTypeNames, mergeDirectives, }: {
+ subschemas: Array<Subschema<any, any, any, TContext>>;
+ originalSubschemaMap: Map<Subschema<any, any, any, TContext>, GraphQLSchema | SubschemaConfig<any, any, any, TContext>>;
types: Array<GraphQLNamedType>;
- typeDefs: ITypeDefinitions;
+ typeDefs: ITypeDefinitions | undefined;
parseOptions: GraphQLParseOptions;
extensions: Array<DocumentNode>;
directiveMap: Record<string, GraphQLDirective>;
@@ -15,16 +15,16 @@ export declare function buildTypeCandidates({ subschemas, originalSubschemaMap,
schemaExtensions: Array<SchemaExtensionNode>;
};
operationTypeNames: Record<string, any>;
- mergeDirectives: boolean;
-}): Record<string, Array<MergeTypeCandidate>>;
-export declare function buildTypes({ typeCandidates, directives, stitchingInfo, operationTypeNames, onTypeConflict, mergeTypes, typeMergingOptions, }: {
- typeCandidates: Record<string, Array<MergeTypeCandidate>>;
+ mergeDirectives?: boolean | undefined;
+}): Record<string, Array<MergeTypeCandidate<TContext>>>;
+export declare function buildTypes<TContext = Record<string, any>>({ typeCandidates, directives, stitchingInfo, operationTypeNames, onTypeConflict, mergeTypes, typeMergingOptions, }: {
+ typeCandidates: Record<string, Array<MergeTypeCandidate<TContext>>>;
directives: Array<GraphQLDirective>;
- stitchingInfo: StitchingInfo;
+ stitchingInfo: StitchingInfo<TContext>;
operationTypeNames: Record<string, any>;
- onTypeConflict: OnTypeConflict;
- mergeTypes: boolean | Array<string> | MergeTypeFilter;
- typeMergingOptions: TypeMergingOptions;
+ onTypeConflict?: OnTypeConflict<TContext>;
+ mergeTypes: boolean | Array<string> | MergeTypeFilter<TContext>;
+ typeMergingOptions?: TypeMergingOptions<TContext>;
}): {
typeMap: TypeMap;
directives: Array<GraphQLDirective>;
diff --git a/./diff/old/dist/stitch/src/types.d.ts b/./diff/new/dist/stitch/src/types.d.ts
index 78281c0e..c7a59485 100644
--- a/./diff/old/dist/stitch/src/types.d.ts
+++ b/./diff/new/dist/stitch/src/types.d.ts
@@ -1,5 +1,5 @@
import { GraphQLNamedType, GraphQLSchema, SelectionSetNode, FieldNode, GraphQLFieldConfig, GraphQLObjectType, GraphQLInterfaceType, GraphQLInputFieldConfig, GraphQLInputObjectType, GraphQLEnumValueConfig, GraphQLEnumType } from 'graphql';
-import { ITypeDefinitions } from '@graphql-tools/utils';
+import { ITypeDefinitions, Maybe } from '@graphql-tools/utils';
import { Subschema, SubschemaConfig } from '@graphql-tools/delegate';
import { IExecutableSchemaDefinition } from '@graphql-tools/schema';
export interface MergeTypeCandidate<TContext = Record<string, any>> {
@@ -33,8 +33,8 @@ export interface IStitchSchemasOptions<TContext = Record<string, any>> extends O
subschemas?: Array<GraphQLSchema | SubschemaConfig<any, any, any, TContext> | Array<SubschemaConfig<any, any, any, TContext>>>;
typeDefs?: ITypeDefinitions;
types?: Array<GraphQLNamedType>;
- onTypeConflict?: OnTypeConflict;
- mergeDirectives?: boolean;
+ onTypeConflict?: OnTypeConflict<TContext>;
+ mergeDirectives?: boolean | undefined;
mergeTypes?: boolean | Array<string> | MergeTypeFilter<TContext>;
typeMergingOptions?: TypeMergingOptions<TContext>;
subschemaConfigTransforms?: Array<SubschemaConfigTransform<TContext>>;
@@ -44,8 +44,8 @@ export interface TypeMergingOptions<TContext = Record<string, any>> {
validationSettings?: ValidationSettings;
validationScopes?: Record<string, ValidationSettings>;
typeCandidateMerger?: (candidates: Array<MergeTypeCandidate<TContext>>) => MergeTypeCandidate<TContext>;
- typeDescriptionsMerger?: (candidates: Array<MergeTypeCandidate<TContext>>) => string;
- fieldConfigMerger?: (candidates: Array<MergeFieldConfigCandidate<TContext>>) => GraphQLFieldConfig<any, any>;
+ typeDescriptionsMerger?: (candidates: Array<MergeTypeCandidate<TContext>>) => Maybe<string>;
+ fieldConfigMerger?: (candidates: Array<MergeFieldConfigCandidate<TContext>>) => GraphQLFieldConfig<any, TContext>;
inputFieldConfigMerger?: (candidates: Array<MergeInputFieldConfigCandidate<TContext>>) => GraphQLInputFieldConfig;
enumValueConfigMerger?: (candidates: Array<MergeEnumValueConfigCandidate<TContext>>) => GraphQLEnumValueConfig;
}
diff --git a/./diff/old/dist/stitching-directives/src/defaultStitchingDirectiveOptions.d.ts b/./diff/new/dist/stitching-directives/src/defaultStitchingDirectiveOptions.d.ts
index d01401fd..742cf63b 100644
--- a/./diff/old/dist/stitching-directives/src/defaultStitchingDirectiveOptions.d.ts
+++ b/./diff/new/dist/stitching-directives/src/defaultStitchingDirectiveOptions.d.ts
@@ -1,2 +1,2 @@
-import { StitchingDirectivesOptions } from './types';
-export declare const defaultStitchingDirectiveOptions: StitchingDirectivesOptions;
+import { StitchingDirectivesFinalOptions } from './types';
+export declare const defaultStitchingDirectiveOptions: StitchingDirectivesFinalOptions;
diff --git a/./diff/old/dist/stitching-directives/src/types.d.ts b/./diff/new/dist/stitching-directives/src/types.d.ts
index 39635b5f..b53b8a4b 100644
--- a/./diff/old/dist/stitching-directives/src/types.d.ts
+++ b/./diff/new/dist/stitching-directives/src/types.d.ts
@@ -24,7 +24,12 @@ export interface StitchingDirectivesOptions {
canonicalDirectiveName?: string;
pathToDirectivesInExtensions?: Array<string>;
}
+declare type Complete<T> = {
+ [P in keyof Required<T>]: Exclude<Pick<T, P> extends Required<Pick<T, P>> ? T[P] : T[P] | undefined, undefined>;
+};
+export declare type StitchingDirectivesFinalOptions = Complete<StitchingDirectivesOptions>;
export interface MergedTypeResolverInfo extends ParsedMergeArgsExpr {
fieldName: string;
returnsList: boolean;
}
+export {};
diff --git a/./diff/old/dist/utils/src/Interfaces.d.ts b/./diff/new/dist/utils/src/Interfaces.d.ts
index 76eed82c..56c77eb9 100644
--- a/./diff/old/dist/utils/src/Interfaces.d.ts
+++ b/./diff/new/dist/utils/src/Interfaces.d.ts
@@ -120,8 +120,9 @@ export interface IFieldResolverOptions<TSource = any, TContext = any, TArgs = an
export declare type FieldNodeMapper = (fieldNode: FieldNode, fragments: Record<string, FragmentDefinitionNode>, transformationContext: Record<string, any>) => SelectionNode | Array<SelectionNode>;
export declare type FieldNodeMappers = Record<string, Record<string, FieldNodeMapper>>;
export declare type InputFieldFilter = (typeName?: string, fieldName?: string, inputFieldConfig?: GraphQLInputFieldConfig) => boolean;
-export declare type FieldFilter = (typeName?: string, fieldName?: string, fieldConfig?: GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig) => boolean;
-export declare type RootFieldFilter = (operation?: 'Query' | 'Mutation' | 'Subscription', rootFieldName?: string, fieldConfig?: GraphQLFieldConfig<any, any>) => boolean;
+export declare type FieldFilter = (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig) => boolean;
+export declare type ObjectFieldFilter = (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig<any, any>) => boolean;
+export declare type RootFieldFilter = (operation: 'Query' | 'Mutation' | 'Subscription', rootFieldName: string, fieldConfig: GraphQLFieldConfig<any, any>) => boolean;
export declare type TypeFilter = (typeName: string, type: GraphQLType) => boolean;
export declare type ArgumentFilter = (typeName?: string, fieldName?: string, argName?: string, argConfig?: GraphQLArgumentConfig) => boolean;
export declare type RenameTypesOptions = {
@@ -277,6 +278,7 @@ export interface SchemaMapper {
[MapperKind.INPUT_OBJECT_FIELD]?: InputFieldMapper;
[MapperKind.DIRECTIVE]?: DirectiveMapper;
}
+export declare type SchemaFieldMapperTypes = Array<MapperKind.FIELD | MapperKind.COMPOSITE_FIELD | MapperKind.OBJECT_FIELD | MapperKind.ROOT_FIELD | MapperKind.QUERY_ROOT_FIELD | MapperKind.MUTATION_ROOT_FIELD | MapperKind.SUBSCRIPTION_ROOT_FIELD | MapperKind.INTERFACE_FIELD | MapperKind.INPUT_OBJECT_FIELD>;
export declare type NamedTypeMapper = (type: GraphQLNamedType, schema: GraphQLSchema) => GraphQLNamedType | null | undefined;
export declare type ScalarTypeMapper = (type: GraphQLScalarType, schema: GraphQLSchema) => GraphQLScalarType | null | undefined;
export declare type EnumTypeMapper = (type: GraphQLEnumType, schema: GraphQLSchema) => GraphQLEnumType | null | undefined;
diff --git a/./diff/old/dist/utils/src/astFromValueUntyped.d.ts b/./diff/new/dist/utils/src/astFromValueUntyped.d.ts
index 389b42f8..cdb59f5e 100644
--- a/./diff/old/dist/utils/src/astFromValueUntyped.d.ts
+++ b/./diff/new/dist/utils/src/astFromValueUntyped.d.ts
@@ -14,4 +14,4 @@ import { ValueNode } from 'graphql';
* | null | NullValue |
*
*/
-export declare function astFromValueUntyped(value: any): ValueNode;
+export declare function astFromValueUntyped(value: any): ValueNode | null;
diff --git a/./diff/old/dist/utils/src/create-schema-definition.d.ts b/./diff/new/dist/utils/src/create-schema-definition.d.ts
index 8cb87844..33f5cef5 100644
--- a/./diff/old/dist/utils/src/create-schema-definition.d.ts
+++ b/./diff/new/dist/utils/src/create-schema-definition.d.ts
@@ -5,4 +5,4 @@ export declare function createSchemaDefinition(def: {
subscription: string | GraphQLObjectType | null;
}, config?: {
force?: boolean;
-}): string;
+}): string | undefined;
diff --git a/./diff/old/dist/utils/src/executor.d.ts b/./diff/new/dist/utils/src/executor.d.ts
index ed7c885c..e57375b7 100644
--- a/./diff/old/dist/utils/src/executor.d.ts
+++ b/./diff/new/dist/utils/src/executor.d.ts
@@ -1,6 +1,6 @@
import { DocumentNode, GraphQLResolveInfo } from 'graphql';
import { ExecutionResult } from './Interfaces';
-export interface ExecutionParams<TArgs = Record<string, any>, TContext = any> {
+export interface ExecutionParams<TArgs extends Record<string, any> = Record<string, any>, TContext = any> {
document: DocumentNode;
variables?: TArgs;
extensions?: Record<string, any>;
@@ -10,4 +10,4 @@ export interface ExecutionParams<TArgs = Record<string, any>, TContext = any> {
export declare type AsyncExecutor<TBaseContext = Record<string, any>> = <TReturn = Record<string, any>, TArgs = Record<string, any>, TContext extends TBaseContext = TBaseContext>(params: ExecutionParams<TArgs, TContext>) => Promise<ExecutionResult<TReturn>>;
export declare type SyncExecutor<TBaseContext = Record<string, any>> = <TReturn = Record<string, any>, TArgs = Record<string, any>, TContext extends TBaseContext = TBaseContext>(params: ExecutionParams<TArgs, TContext>) => ExecutionResult<TReturn>;
export declare type Executor<TBaseContext = Record<string, any>> = <TReturn = Record<string, any>, TArgs = Record<string, any>, TContext extends TBaseContext = TBaseContext>(params: ExecutionParams<TArgs, TContext>) => ExecutionResult<TReturn> | Promise<ExecutionResult<TReturn>>;
-export declare type Subscriber<TBaseContext = Record<string, any>> = <TReturn = Record<string, any>, TArgs = Record<string, any>, TContext extends TBaseContext = TBaseContext>(params: ExecutionParams<TArgs, TContext>) => Promise<AsyncIterator<ExecutionResult<TReturn>> | ExecutionResult<TReturn>>;
+export declare type Subscriber<TBaseContext = Record<string, any>> = <TReturn = Record<string, any>, TArgs = Record<string, any>, TContext extends TBaseContext = TBaseContext>(params: ExecutionParams<TArgs, TContext>) => Promise<AsyncIterableIterator<ExecutionResult<TReturn>> | ExecutionResult<TReturn>>;
diff --git a/./diff/old/dist/utils/src/get-directives.d.ts b/./diff/new/dist/utils/src/get-directives.d.ts
index c834712d..2c29830e 100644
--- a/./diff/old/dist/utils/src/get-directives.d.ts
+++ b/./diff/new/dist/utils/src/get-directives.d.ts
@@ -1,8 +1,9 @@
import { GraphQLSchema, GraphQLNamedType, GraphQLField, GraphQLInputField, GraphQLFieldConfig, GraphQLInputFieldConfig, GraphQLSchemaConfig, GraphQLObjectTypeConfig, GraphQLInterfaceTypeConfig, GraphQLUnionTypeConfig, GraphQLScalarTypeConfig, GraphQLEnumTypeConfig, GraphQLInputObjectTypeConfig, GraphQLEnumValue, GraphQLEnumValueConfig } from 'graphql';
+import { Maybe } from 'packages/graphql-tools/src';
export declare type DirectiveUseMap = {
[key: string]: any;
};
declare type DirectableGraphQLObject = GraphQLSchema | GraphQLSchemaConfig | GraphQLNamedType | GraphQLObjectTypeConfig<any, any> | GraphQLInterfaceTypeConfig<any, any> | GraphQLUnionTypeConfig<any, any> | GraphQLScalarTypeConfig<any, any> | GraphQLEnumTypeConfig | GraphQLEnumValue | GraphQLEnumValueConfig | GraphQLInputObjectTypeConfig | GraphQLField<any, any> | GraphQLInputField | GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig;
-export declare function getDirectivesInExtensions(node: DirectableGraphQLObject, pathToDirectivesInExtensions?: string[]): DirectiveUseMap;
+export declare function getDirectivesInExtensions(node: DirectableGraphQLObject, pathToDirectivesInExtensions?: string[]): Maybe<DirectiveUseMap>;
export declare function getDirectives(schema: GraphQLSchema, node: DirectableGraphQLObject, pathToDirectivesInExtensions?: string[]): DirectiveUseMap;
export {};
diff --git a/./diff/old/dist/utils/src/helpers.d.ts b/./diff/new/dist/utils/src/helpers.d.ts
index a58154bc..c8aabe6b 100644
--- a/./diff/old/dist/utils/src/helpers.d.ts
+++ b/./diff/new/dist/utils/src/helpers.d.ts
@@ -7,3 +7,5 @@ export declare function isValidPath(str: string): boolean;
export declare function compareStrings<A, B>(a: A, b: B): 0 | 1 | -1;
export declare function nodeToString(a: ASTNode): string;
export declare function compareNodes(a: ASTNode, b: ASTNode, customFn?: (a: any, b: any) => number): number;
+export declare function isSome<T>(input: T): input is Exclude<T, null | undefined>;
+export declare function assertSome<T>(input: T, message?: string): asserts input is Exclude<T, null | undefined>;
diff --git a/./diff/old/dist/utils/src/implementsAbstractType.d.ts b/./diff/new/dist/utils/src/implementsAbstractType.d.ts
index 84f74d53..c9466ec7 100644
--- a/./diff/old/dist/utils/src/implementsAbstractType.d.ts
+++ b/./diff/new/dist/utils/src/implementsAbstractType.d.ts
@@ -1,2 +1,3 @@
import { GraphQLType, GraphQLSchema } from 'graphql';
-export declare function implementsAbstractType(schema: GraphQLSchema, typeA: GraphQLType, typeB: GraphQLType): boolean;
+import { Maybe } from '@graphql-tools/utils';
+export declare function implementsAbstractType(schema: GraphQLSchema, typeA: Maybe<GraphQLType>, typeB: Maybe<GraphQLType>): boolean;
diff --git a/./diff/old/dist/utils/src/loaders.d.ts b/./diff/new/dist/utils/src/loaders.d.ts
index e528a8e9..f623e6cc 100644
--- a/./diff/old/dist/utils/src/loaders.d.ts
+++ b/./diff/new/dist/utils/src/loaders.d.ts
@@ -22,8 +22,8 @@ export interface Loader<TPointer = string, TOptions extends SingleFileOptions =
canLoadSync?(pointer: TPointer, options?: TOptions): boolean;
resolveGlobs?(globs: ResolverGlobs, options?: TOptions): Promise<TPointer[] | never>;
resolveGlobsSync?(globs: ResolverGlobs, options?: TOptions): TPointer[];
- load(pointer: TPointer, options?: TOptions): Promise<Source | never>;
- loadSync?(pointer: TPointer, options?: TOptions): Source | never;
+ load(pointer: TPointer, options?: TOptions): Promise<Source | null | never>;
+ loadSync?(pointer: TPointer, options?: TOptions): Source | null | never;
}
export declare type SchemaLoader<TOptions extends SingleFileOptions = SingleFileOptions> = Loader<SchemaPointerSingle, TOptions>;
export declare type DocumentLoader<TOptions extends SingleFileOptions = SingleFileOptions> = Loader<DocumentPointerSingle, TOptions>;
diff --git a/./diff/old/dist/utils/src/parse-graphql-sdl.d.ts b/./diff/new/dist/utils/src/parse-graphql-sdl.d.ts
index 7a63659c..61191c43 100644
--- a/./diff/old/dist/utils/src/parse-graphql-sdl.d.ts
+++ b/./diff/new/dist/utils/src/parse-graphql-sdl.d.ts
@@ -1,11 +1,11 @@
import { DocumentNode, ASTNode, StringValueNode } from 'graphql';
import { GraphQLParseOptions } from './Interfaces';
-export declare function parseGraphQLSDL(location: string, rawSDL: string, options?: GraphQLParseOptions): {
- location: string;
+export declare function parseGraphQLSDL(location: string | undefined, rawSDL: string, options?: GraphQLParseOptions): {
+ location: string | undefined;
document: DocumentNode;
};
export declare function getLeadingCommentBlock(node: ASTNode): void | string;
-export declare function transformCommentsToDescriptions(sourceSdl: string, options?: GraphQLParseOptions): DocumentNode | null;
+export declare function transformCommentsToDescriptions(sourceSdl: string, options?: GraphQLParseOptions): DocumentNode;
declare type DiscriminateUnion<T, U> = T extends U ? T : never;
declare type DescribableASTNodes = DiscriminateUnion<ASTNode, {
description?: StringValueNode;
diff --git a/./diff/old/dist/utils/src/print-schema-with-directives.d.ts b/./diff/new/dist/utils/src/print-schema-with-directives.d.ts
index 1c1ab98c..379b5152 100644
--- a/./diff/old/dist/utils/src/print-schema-with-directives.d.ts
+++ b/./diff/new/dist/utils/src/print-schema-with-directives.d.ts
@@ -1,21 +1,21 @@
import { GraphQLSchema, GraphQLNamedType, DirectiveNode, FieldDefinitionNode, InputValueDefinitionNode, GraphQLArgument, EnumValueDefinitionNode, GraphQLDirective, DirectiveDefinitionNode, SchemaDefinitionNode, SchemaExtensionNode, GraphQLObjectType, ObjectTypeDefinitionNode, GraphQLField, GraphQLInterfaceType, InterfaceTypeDefinitionNode, UnionTypeDefinitionNode, GraphQLUnionType, GraphQLInputObjectType, InputObjectTypeDefinitionNode, GraphQLInputField, GraphQLEnumType, GraphQLEnumValue, EnumTypeDefinitionNode, GraphQLScalarType, ScalarTypeDefinitionNode, DocumentNode } from 'graphql';
-import { GetDocumentNodeFromSchemaOptions, PrintSchemaWithDirectivesOptions } from './types';
+import { GetDocumentNodeFromSchemaOptions, PrintSchemaWithDirectivesOptions, Maybe } from './types';
export declare function getDocumentNodeFromSchema(schema: GraphQLSchema, options?: GetDocumentNodeFromSchemaOptions): DocumentNode;
export declare function printSchemaWithDirectives(schema: GraphQLSchema, options?: PrintSchemaWithDirectivesOptions): string;
-export declare function astFromSchema(schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): SchemaDefinitionNode | SchemaExtensionNode;
+export declare function astFromSchema(schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): SchemaDefinitionNode | SchemaExtensionNode | null;
export declare function astFromDirective(directive: GraphQLDirective, schema?: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): DirectiveDefinitionNode;
-export declare function getDirectiveNodes(entity: GraphQLSchema | GraphQLNamedType | GraphQLEnumValue, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): Array<DirectiveNode>;
-export declare function getDeprecatableDirectiveNodes(entity: GraphQLArgument | GraphQLField<any, any> | GraphQLInputField, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): Array<DirectiveNode>;
-export declare function astFromArg(arg: GraphQLArgument, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): InputValueDefinitionNode;
-export declare function astFromObjectType(type: GraphQLObjectType, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): ObjectTypeDefinitionNode;
-export declare function astFromInterfaceType(type: GraphQLInterfaceType, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): InterfaceTypeDefinitionNode;
-export declare function astFromUnionType(type: GraphQLUnionType, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): UnionTypeDefinitionNode;
-export declare function astFromInputObjectType(type: GraphQLInputObjectType, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): InputObjectTypeDefinitionNode;
-export declare function astFromEnumType(type: GraphQLEnumType, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): EnumTypeDefinitionNode;
-export declare function astFromScalarType(type: GraphQLScalarType, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): ScalarTypeDefinitionNode;
-export declare function astFromField(field: GraphQLField<any, any>, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): FieldDefinitionNode;
-export declare function astFromInputField(field: GraphQLInputField, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): InputValueDefinitionNode;
-export declare function astFromEnumValue(value: GraphQLEnumValue, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): EnumValueDefinitionNode;
+export declare function getDirectiveNodes(entity: GraphQLSchema | GraphQLNamedType | GraphQLEnumValue, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): Array<DirectiveNode>;
+export declare function getDeprecatableDirectiveNodes(entity: GraphQLArgument | GraphQLField<any, any> | GraphQLInputField, schema?: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): Array<DirectiveNode>;
+export declare function astFromArg(arg: GraphQLArgument, schema?: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): InputValueDefinitionNode;
+export declare function astFromObjectType(type: GraphQLObjectType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): ObjectTypeDefinitionNode;
+export declare function astFromInterfaceType(type: GraphQLInterfaceType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): InterfaceTypeDefinitionNode;
+export declare function astFromUnionType(type: GraphQLUnionType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): UnionTypeDefinitionNode;
+export declare function astFromInputObjectType(type: GraphQLInputObjectType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): InputObjectTypeDefinitionNode;
+export declare function astFromEnumType(type: GraphQLEnumType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): EnumTypeDefinitionNode;
+export declare function astFromScalarType(type: GraphQLScalarType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): ScalarTypeDefinitionNode;
+export declare function astFromField(field: GraphQLField<any, any>, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): FieldDefinitionNode;
+export declare function astFromInputField(field: GraphQLInputField, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): InputValueDefinitionNode;
+export declare function astFromEnumValue(value: GraphQLEnumValue, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): EnumValueDefinitionNode;
export declare function makeDeprecatedDirective(deprecationReason: string): DirectiveNode;
-export declare function makeDirectiveNode(name: string, args: Record<string, any>, directive?: GraphQLDirective): DirectiveNode;
-export declare function makeDirectiveNodes(schema: GraphQLSchema, directiveValues: Record<string, any>): Array<DirectiveNode>;
+export declare function makeDirectiveNode(name: string, args: Record<string, any>, directive?: Maybe<GraphQLDirective>): DirectiveNode;
+export declare function makeDirectiveNodes(schema: Maybe<GraphQLSchema>, directiveValues: Record<string, any>): Array<DirectiveNode>;
diff --git a/./diff/old/dist/utils/src/transformInputValue.d.ts b/./diff/new/dist/utils/src/transformInputValue.d.ts
index a518bff4..e84ff9fd 100644
--- a/./diff/old/dist/utils/src/transformInputValue.d.ts
+++ b/./diff/new/dist/utils/src/transformInputValue.d.ts
@@ -1,6 +1,6 @@
import { GraphQLInputType } from 'graphql';
-import { InputLeafValueTransformer, InputObjectValueTransformer } from './types';
-export declare function transformInputValue(type: GraphQLInputType, value: any, inputLeafValueTransformer?: InputLeafValueTransformer, inputObjectValueTransformer?: InputObjectValueTransformer): any;
+import { InputLeafValueTransformer, InputObjectValueTransformer, Maybe } from './types';
+export declare function transformInputValue(type: GraphQLInputType, value: any, inputLeafValueTransformer?: Maybe<InputLeafValueTransformer>, inputObjectValueTransformer?: Maybe<InputObjectValueTransformer>): any;
export declare function serializeInputValue(type: GraphQLInputType, value: any): any;
export declare function parseInputValue(type: GraphQLInputType, value: any): any;
export declare function parseInputValueLiteral(type: GraphQLInputType, value: any): any;
diff --git a/./diff/old/dist/utils/src/validate-documents.d.ts b/./diff/new/dist/utils/src/validate-documents.d.ts
index 41731b57..70983d2b 100644
--- a/./diff/old/dist/utils/src/validate-documents.d.ts
+++ b/./diff/new/dist/utils/src/validate-documents.d.ts
@@ -2,7 +2,7 @@ import { GraphQLSchema, GraphQLError, ValidationContext, ASTVisitor } from 'grap
import { Source } from './loaders';
export declare type ValidationRule = (context: ValidationContext) => ASTVisitor;
export interface LoadDocumentError {
- readonly filePath: string;
+ readonly filePath?: string;
readonly errors: ReadonlyArray<GraphQLError>;
}
export declare function validateGraphQlDocuments(schema: GraphQLSchema, documentFiles: Source[], effectiveRules?: ValidationRule[]): Promise<ReadonlyArray<LoadDocumentError>>;
diff --git a/./diff/old/dist/webpack-loader/src/index.d.ts b/./diff/new/dist/webpack-loader/src/index.d.ts
index dd5da653..71adc84a 100644
--- a/./diff/old/dist/webpack-loader/src/index.d.ts
+++ b/./diff/new/dist/webpack-loader/src/index.d.ts
@@ -1 +1,11 @@
-export default function graphqlLoader(source: string): string;
+import type { LoaderContext } from 'webpack';
+interface Options {
+ noDescription?: boolean;
+ noEmptyNodes?: boolean;
+ noLoc?: boolean;
+ replaceKinds?: boolean;
+ esModule?: boolean;
+ importHelpers?: boolean;
+}
+export default function graphqlLoader(this: LoaderContext<Options>, source: string): string;
+export {};
diff --git a/./diff/old/dist/wrap/src/generateProxyingResolvers.d.ts b/./diff/new/dist/wrap/src/generateProxyingResolvers.d.ts
index 62512460..d871f8af 100644
--- a/./diff/old/dist/wrap/src/generateProxyingResolvers.d.ts
+++ b/./diff/new/dist/wrap/src/generateProxyingResolvers.d.ts
@@ -1,4 +1,4 @@
import { GraphQLFieldResolver } from 'graphql';
import { SubschemaConfig, ICreateProxyingResolverOptions } from '@graphql-tools/delegate';
-export declare function generateProxyingResolvers(subschemaConfig: SubschemaConfig): Record<string, Record<string, GraphQLFieldResolver<any, any>>>;
-export declare function defaultCreateProxyingResolver({ subschemaConfig, operation, transformedSchema, }: ICreateProxyingResolverOptions): GraphQLFieldResolver<any, any>;
+export declare function generateProxyingResolvers<TContext>(subschemaConfig: SubschemaConfig<any, any, any, TContext>): Record<string, Record<string, GraphQLFieldResolver<any, any>>>;
+export declare function defaultCreateProxyingResolver<TContext>({ subschemaConfig, operation, transformedSchema, }: ICreateProxyingResolverOptions<TContext>): GraphQLFieldResolver<any, any>;
diff --git a/./diff/old/dist/wrap/src/makeRemoteExecutableSchema.d.ts b/./diff/new/dist/wrap/src/makeRemoteExecutableSchema.d.ts
index 28799d27..df53dd95 100644
--- a/./diff/old/dist/wrap/src/makeRemoteExecutableSchema.d.ts
+++ b/./diff/new/dist/wrap/src/makeRemoteExecutableSchema.d.ts
@@ -2,4 +2,4 @@ import { GraphQLFieldResolver, GraphQLSchema } from 'graphql';
import { IMakeRemoteExecutableSchemaOptions } from './types';
import { Executor, Subscriber } from '@graphql-tools/utils';
export declare function makeRemoteExecutableSchema({ schema: schemaOrTypeDefs, executor, subscriber, createResolver, buildSchemaOptions, }: IMakeRemoteExecutableSchemaOptions): GraphQLSchema;
-export declare function defaultCreateRemoteResolver(executor: Executor, subscriber: Subscriber): GraphQLFieldResolver<any, any>;
+export declare function defaultCreateRemoteResolver(executor: Executor, subscriber?: Subscriber | undefined): GraphQLFieldResolver<any, any>;
diff --git a/./diff/old/dist/wrap/src/transforms/FilterObjectFields.d.ts b/./diff/new/dist/wrap/src/transforms/FilterObjectFields.d.ts
index 7510d6f5..5c773ebf 100644
--- a/./diff/old/dist/wrap/src/transforms/FilterObjectFields.d.ts
+++ b/./diff/new/dist/wrap/src/transforms/FilterObjectFields.d.ts
@@ -1,8 +1,8 @@
import { GraphQLSchema } from 'graphql';
-import { FieldFilter } from '@graphql-tools/utils';
+import { ObjectFieldFilter } from '@graphql-tools/utils';
import { SubschemaConfig, Transform } from '@graphql-tools/delegate';
export default class FilterObjectFields implements Transform {
private readonly transformer;
- constructor(filter: FieldFilter);
+ constructor(filter: ObjectFieldFilter);
transformSchema(originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig, transformedSchema?: GraphQLSchema): GraphQLSchema;
}
diff --git a/./diff/old/dist/wrap/src/transforms/MapFields.d.ts b/./diff/new/dist/wrap/src/transforms/MapFields.d.ts
index e00074c5..765c2ed0 100644
--- a/./diff/old/dist/wrap/src/transforms/MapFields.d.ts
+++ b/./diff/new/dist/wrap/src/transforms/MapFields.d.ts
@@ -2,13 +2,14 @@ import { GraphQLSchema } from 'graphql';
import { Request, FieldNodeMappers, ExecutionResult } from '@graphql-tools/utils';
import { Transform, DelegationContext, SubschemaConfig } from '@graphql-tools/delegate';
import { ObjectValueTransformerMap, ErrorsTransformer } from '../types';
-export default class MapFields implements Transform {
+export default class MapFields<TContext> implements Transform<any, TContext> {
private fieldNodeTransformerMap;
private objectValueTransformerMap?;
private errorsTransformer?;
private transformer;
constructor(fieldNodeTransformerMap: FieldNodeMappers, objectValueTransformerMap?: ObjectValueTransformerMap, errorsTransformer?: ErrorsTransformer);
- transformSchema(originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig, transformedSchema?: GraphQLSchema): GraphQLSchema;
+ private _getTransformer;
+ transformSchema(originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig<any, any, any, TContext>, transformedSchema?: GraphQLSchema): GraphQLSchema;
transformRequest(originalRequest: Request, delegationContext: DelegationContext, transformationContext: Record<string, any>): Request;
transformResult(originalResult: ExecutionResult, delegationContext: DelegationContext, transformationContext: Record<string, any>): ExecutionResult;
}
diff --git a/./diff/old/dist/wrap/src/transforms/MapLeafValues.d.ts b/./diff/new/dist/wrap/src/transforms/MapLeafValues.d.ts
index db707f83..98a6335f 100644
--- a/./diff/old/dist/wrap/src/transforms/MapLeafValues.d.ts
+++ b/./diff/new/dist/wrap/src/transforms/MapLeafValues.d.ts
@@ -12,9 +12,11 @@ export default class MapLeafValues implements Transform<MapLeafValuesTransformat
private originalWrappingSchema;
private typeInfo;
constructor(inputValueTransformer: LeafValueTransformer, outputValueTransformer: LeafValueTransformer);
+ private _getTypeInfo;
+ private _getOriginalWrappingSchema;
transformSchema(originalWrappingSchema: GraphQLSchema, _subschemaConfig: SubschemaConfig, _transformedSchema?: GraphQLSchema): GraphQLSchema;
- transformRequest(originalRequest: Request, _delegationContext: DelegationContext, transformationContext?: MapLeafValuesTransformationContext): Request;
- transformResult(originalResult: ExecutionResult, _delegationContext: DelegationContext, transformationContext?: MapLeafValuesTransformationContext): ExecutionResult;
+ transformRequest(originalRequest: Request, _delegationContext: DelegationContext, transformationContext: MapLeafValuesTransformationContext): Request;
+ transformResult(originalResult: ExecutionResult, _delegationContext: DelegationContext, transformationContext: MapLeafValuesTransformationContext): ExecutionResult;
private transformOperations;
private transformFieldNode;
}
diff --git a/./diff/old/dist/wrap/src/transforms/RenameInputObjectFields.d.ts b/./diff/new/dist/wrap/src/transforms/RenameInputObjectFields.d.ts
index 2f575a75..80ef1196 100644
--- a/./diff/old/dist/wrap/src/transforms/RenameInputObjectFields.d.ts
+++ b/./diff/new/dist/wrap/src/transforms/RenameInputObjectFields.d.ts
@@ -1,11 +1,13 @@
import { GraphQLSchema, GraphQLInputFieldConfig } from 'graphql';
import { Request } from '@graphql-tools/utils';
import { Transform, DelegationContext, SubschemaConfig } from '@graphql-tools/delegate';
+declare type RenamerFunction = (typeName: string, fieldName: string, inputFieldConfig: GraphQLInputFieldConfig) => string | undefined;
export default class RenameInputObjectFields implements Transform {
private readonly renamer;
private readonly transformer;
private reverseMap;
- constructor(renamer: (typeName: string, fieldName: string, inputFieldConfig: GraphQLInputFieldConfig) => string);
+ constructor(renamer: RenamerFunction);
transformSchema(originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig, transformedSchema?: GraphQLSchema): GraphQLSchema;
transformRequest(originalRequest: Request, delegationContext: DelegationContext, transformationContext: Record<string, any>): Request;
}
+export {};
diff --git a/./diff/old/dist/wrap/src/transforms/TransformCompositeFields.d.ts b/./diff/new/dist/wrap/src/transforms/TransformCompositeFields.d.ts
index 9c2765d4..9ab5fa54 100644
--- a/./diff/old/dist/wrap/src/transforms/TransformCompositeFields.d.ts
+++ b/./diff/new/dist/wrap/src/transforms/TransformCompositeFields.d.ts
@@ -2,7 +2,7 @@ import { GraphQLSchema } from 'graphql';
import { Request, ExecutionResult } from '@graphql-tools/utils';
import { Transform, DelegationContext, SubschemaConfig } from '@graphql-tools/delegate';
import { FieldTransformer, FieldNodeTransformer, DataTransformer, ErrorsTransformer } from '../types';
-export default class TransformCompositeFields implements Transform {
+export default class TransformCompositeFields<TContext = Record<string, any>> implements Transform<any, TContext> {
private readonly fieldTransformer;
private readonly fieldNodeTransformer;
private readonly dataTransformer;
@@ -12,7 +12,8 @@ export default class TransformCompositeFields implements Transform {
private mapping;
private subscriptionTypeName;
constructor(fieldTransformer: FieldTransformer, fieldNodeTransformer?: FieldNodeTransformer, dataTransformer?: DataTransformer, errorsTransformer?: ErrorsTransformer);
- transformSchema(originalWrappingSchema: GraphQLSchema, _subschemaConfig: SubschemaConfig, _transformedSchema?: GraphQLSchema): GraphQLSchema;
+ private _getTypeInfo;
+ transformSchema(originalWrappingSchema: GraphQLSchema, _subschemaConfig: SubschemaConfig<any, any, any, TContext>, _transformedSchema?: GraphQLSchema): GraphQLSchema;
transformRequest(originalRequest: Request, _delegationContext: DelegationContext, transformationContext: Record<string, any>): Request;
transformResult(result: ExecutionResult, _delegationContext: DelegationContext, transformationContext: Record<string, any>): ExecutionResult;
private transformDocument;
diff --git a/./diff/old/dist/wrap/src/transforms/TransformInputObjectFields.d.ts b/./diff/new/dist/wrap/src/transforms/TransformInputObjectFields.d.ts
index 32d49d9c..7aafaac9 100644
--- a/./diff/old/dist/wrap/src/transforms/TransformInputObjectFields.d.ts
+++ b/./diff/new/dist/wrap/src/transforms/TransformInputObjectFields.d.ts
@@ -9,6 +9,7 @@ export default class TransformInputObjectFields implements Transform {
private transformedSchema;
private mapping;
constructor(inputFieldTransformer: InputFieldTransformer, inputFieldNodeTransformer?: InputFieldNodeTransformer, inputObjectNodeTransformer?: InputObjectNodeTransformer);
+ private _getTransformedSchema;
transformSchema(originalWrappingSchema: GraphQLSchema, _subschemaConfig: SubschemaConfig, _transformedSchema?: GraphQLSchema): GraphQLSchema;
transformRequest(originalRequest: Request, delegationContext: DelegationContext, _transformationContext: Record<string, any>): Request;
private transformDocument;
diff --git a/./diff/old/dist/wrap/src/transforms/TransformInterfaceFields.d.ts b/./diff/new/dist/wrap/src/transforms/TransformInterfaceFields.d.ts
index 8e2685f5..0f30f2f7 100644
--- a/./diff/old/dist/wrap/src/transforms/TransformInterfaceFields.d.ts
+++ b/./diff/new/dist/wrap/src/transforms/TransformInterfaceFields.d.ts
@@ -7,6 +7,7 @@ export default class TransformInterfaceFields implements Transform {
private readonly fieldNodeTransformer;
private transformer;
constructor(interfaceFieldTransformer: FieldTransformer, fieldNodeTransformer?: FieldNodeTransformer);
+ private _getTransformer;
transformSchema(originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig, transformedSchema?: GraphQLSchema): GraphQLSchema;
transformRequest(originalRequest: Request, delegationContext: DelegationContext, transformationContext: Record<string, any>): Request;
transformResult(originalResult: ExecutionResult, delegationContext: DelegationContext, transformationContext: Record<string, any>): ExecutionResult;
diff --git a/./diff/old/dist/wrap/src/transforms/TransformObjectFields.d.ts b/./diff/new/dist/wrap/src/transforms/TransformObjectFields.d.ts
index 68ecb577..e8323431 100644
--- a/./diff/old/dist/wrap/src/transforms/TransformObjectFields.d.ts
+++ b/./diff/new/dist/wrap/src/transforms/TransformObjectFields.d.ts
@@ -7,6 +7,7 @@ export default class TransformObjectFields implements Transform {
private readonly fieldNodeTransformer;
private transformer;
constructor(objectFieldTransformer: FieldTransformer, fieldNodeTransformer?: FieldNodeTransformer);
+ private _getTransformer;
transformSchema(originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig, transformedSchema?: GraphQLSchema): GraphQLSchema;
transformRequest(originalRequest: Request, delegationContext: DelegationContext, transformationContext: Record<string, any>): Request;
transformResult(originalResult: ExecutionResult, delegationContext: DelegationContext, transformationContext: Record<string, any>): ExecutionResult;
diff --git a/./diff/old/dist/wrap/src/transforms/TransformRootFields.d.ts b/./diff/new/dist/wrap/src/transforms/TransformRootFields.d.ts
index 11eebbd4..34e8ff40 100644
--- a/./diff/old/dist/wrap/src/transforms/TransformRootFields.d.ts
+++ b/./diff/new/dist/wrap/src/transforms/TransformRootFields.d.ts
@@ -7,6 +7,7 @@ export default class TransformRootFields implements Transform {
private readonly fieldNodeTransformer;
private transformer;
constructor(rootFieldTransformer: RootFieldTransformer, fieldNodeTransformer?: FieldNodeTransformer);
+ private _getTransformer;
transformSchema(originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig, transformedSchema?: GraphQLSchema): GraphQLSchema;
transformRequest(originalRequest: Request, delegationContext: DelegationContext, transformationContext: Record<string, any>): Request;
transformResult(originalResult: ExecutionResult, delegationContext: DelegationContext, transformationContext: Record<string, any>): ExecutionResult;
diff --git a/./diff/old/dist/wrap/src/transforms/WrapFields.d.ts b/./diff/new/dist/wrap/src/transforms/WrapFields.d.ts
index 73bc548f..384fca3b 100644
--- a/./diff/old/dist/wrap/src/transforms/WrapFields.d.ts
+++ b/./diff/new/dist/wrap/src/transforms/WrapFields.d.ts
@@ -8,7 +8,7 @@ interface WrapFieldsTransformationContext {
alias: string;
}>;
}
-export default class WrapFields implements Transform<WrapFieldsTransformationContext> {
+export default class WrapFields<TContext> implements Transform<WrapFieldsTransformationContext, TContext> {
private readonly outerTypeName;
private readonly wrappingFieldNames;
private readonly wrappingTypeNames;
@@ -16,7 +16,7 @@ export default class WrapFields implements Transform<WrapFieldsTransformationCon
private readonly fieldNames;
private readonly transformer;
constructor(outerTypeName: string, wrappingFieldNames: Array<string>, wrappingTypeNames: Array<string>, fieldNames?: Array<string>, prefix?: string);
- transformSchema(originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig, transformedSchema?: GraphQLSchema): GraphQLSchema;
+ transformSchema(originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig<any, any, any, TContext>, transformedSchema?: GraphQLSchema): GraphQLSchema;
transformRequest(originalRequest: Request, delegationContext: DelegationContext, transformationContext: WrapFieldsTransformationContext): Request;
transformResult(originalResult: ExecutionResult, delegationContext: DelegationContext, transformationContext: WrapFieldsTransformationContext): ExecutionResult;
}
diff --git a/./diff/old/dist/wrap/src/types.d.ts b/./diff/new/dist/wrap/src/types.d.ts
index cedccf1e..53c81ef4 100644
--- a/./diff/old/dist/wrap/src/types.d.ts
+++ b/./diff/new/dist/wrap/src/types.d.ts
@@ -1,21 +1,21 @@
import { GraphQLSchema, GraphQLFieldResolver, BuildSchemaOptions, GraphQLInputFieldConfig, GraphQLFieldConfig, FieldNode, FragmentDefinitionNode, SelectionNode, ObjectFieldNode, ObjectValueNode, GraphQLError, GraphQLEnumValueConfig } from 'graphql';
import { DelegationContext } from '@graphql-tools/delegate';
-import { Executor, Subscriber, Request } from '@graphql-tools/utils';
+import { Executor, Subscriber, Request, Maybe } from '@graphql-tools/utils';
export interface IMakeRemoteExecutableSchemaOptions<TContext = Record<string, any>> {
schema: GraphQLSchema | string;
- executor?: Executor<TContext>;
+ executor: Executor<TContext>;
subscriber?: Subscriber<TContext>;
- createResolver?: (executor: Executor<TContext>, subscriber: Subscriber<TContext>) => GraphQLFieldResolver<any, TContext>;
+ createResolver?: (executor: Executor<TContext>, subscriber?: Subscriber<TContext> | undefined) => GraphQLFieldResolver<any, TContext>;
buildSchemaOptions?: BuildSchemaOptions;
}
export declare type InputFieldTransformer = (typeName: string, fieldName: string, inputFieldConfig: GraphQLInputFieldConfig) => GraphQLInputFieldConfig | [string, GraphQLInputFieldConfig] | null | undefined;
export declare type InputFieldNodeTransformer = (typeName: string, fieldName: string, inputFieldNode: ObjectFieldNode, request: Request, delegationContext?: DelegationContext) => ObjectFieldNode | Array<ObjectFieldNode>;
-export declare type InputObjectNodeTransformer = (typeName: string, inputObjectNode: ObjectValueNode, request: Request, delegationContext?: DelegationContext) => ObjectValueNode;
-export declare type FieldTransformer<TContext = Record<string, any>> = (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig<any, TContext>) => GraphQLFieldConfig<any, TContext> | [string, GraphQLFieldConfig<any, TContext>] | null | undefined;
-export declare type RootFieldTransformer<TContext = Record<string, any>> = (operation: 'Query' | 'Mutation' | 'Subscription', fieldName: string, fieldConfig: GraphQLFieldConfig<any, TContext>) => GraphQLFieldConfig<any, TContext> | [string, GraphQLFieldConfig<any, TContext>] | null | undefined;
-export declare type EnumValueTransformer = (typeName: string, externalValue: string, enumValueConfig: GraphQLEnumValueConfig) => GraphQLEnumValueConfig | [string, GraphQLEnumValueConfig] | null | undefined;
-export declare type FieldNodeTransformer = (typeName: string, fieldName: string, fieldNode: FieldNode, fragments: Record<string, FragmentDefinitionNode>, transformationContext: Record<string, any>) => SelectionNode | Array<SelectionNode>;
+export declare type InputObjectNodeTransformer = (typeName: string, inputObjectNode: ObjectValueNode, request: Request, delegationContext?: DelegationContext) => ObjectValueNode | undefined;
+export declare type FieldTransformer<TContext = Record<string, any>> = (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig<any, TContext>) => Maybe<GraphQLFieldConfig<any, TContext> | [string, GraphQLFieldConfig<any, TContext>]>;
+export declare type RootFieldTransformer<TContext = Record<string, any>> = (operation: 'Query' | 'Mutation' | 'Subscription', fieldName: string, fieldConfig: GraphQLFieldConfig<any, TContext>) => Maybe<GraphQLFieldConfig<any, TContext> | [string, GraphQLFieldConfig<any, TContext>]>;
+export declare type EnumValueTransformer = (typeName: string, externalValue: string, enumValueConfig: GraphQLEnumValueConfig) => Maybe<GraphQLEnumValueConfig | [string, GraphQLEnumValueConfig]>;
+export declare type FieldNodeTransformer = (typeName: string, fieldName: string, fieldNode: FieldNode, fragments: Record<string, FragmentDefinitionNode>, transformationContext: Record<string, any>) => Maybe<SelectionNode | Array<SelectionNode>>;
export declare type LeafValueTransformer = (typeName: string, value: any) => any;
export declare type DataTransformer = (value: any, transformationContext: Record<string, any>) => any;
export declare type ObjectValueTransformerMap = Record<string, DataTransformer>;
-export declare type ErrorsTransformer = (errors: ReadonlyArray<GraphQLError>, transformationContext: Record<string, any>) => Array<GraphQLError>;
+export declare type ErrorsTransformer = (errors: ReadonlyArray<GraphQLError> | undefined, transformationContext: Record<string, any>) => Array<GraphQLError> | undefined;
diff --git a/./diff/old/dist/wrap/src/wrapSchema.d.ts b/./diff/new/dist/wrap/src/wrapSchema.d.ts
index 20243a9c..0dba62b1 100644
--- a/./diff/old/dist/wrap/src/wrapSchema.d.ts
+++ b/./diff/new/dist/wrap/src/wrapSchema.d.ts
@@ -1,3 +1,3 @@
import { GraphQLSchema } from 'graphql';
import { SubschemaConfig } from '@graphql-tools/delegate';
-export declare function wrapSchema(subschemaConfig: SubschemaConfig): GraphQLSchema;
+export declare function wrapSchema(subschemaConfig: SubschemaConfig<any, any, any, any>): GraphQLSchema;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment