@graphql-tools/delegate 8.2.2-alpha-5d885fa3.0 → 9.0.0-alpha-881b29e4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Subschema.d.ts +2 -6
- package/Transformer.d.ts +1 -1
- package/defaultMergedResolver.d.ts +3 -1
- package/delegateToSchema.d.ts +5 -2
- package/externalObjects.d.ts +11 -0
- package/externalValues.d.ts +4 -0
- package/getMergedParent.d.ts +9 -0
- package/index.d.ts +3 -2
- package/index.js +631 -305
- package/index.mjs +620 -306
- package/mergeDataAndErrors.d.ts +5 -0
- package/package.json +4 -4
- package/symbols.d.ts +5 -1
- package/types.d.ts +21 -13
- package/checkResultAndHandleErrors.d.ts +0 -8
- package/es5/README.md +0 -7
- package/es5/Subschema.d.ts +0 -19
- package/es5/Transformer.d.ts +0 -10
- package/es5/applySchemaTransforms.d.ts +0 -3
- package/es5/checkResultAndHandleErrors.d.ts +0 -8
- package/es5/createRequest.d.ts +0 -6
- package/es5/defaultMergedResolver.d.ts +0 -9
- package/es5/delegateToSchema.d.ts +0 -6
- package/es5/finalizeGatewayRequest.d.ts +0 -3
- package/es5/getDocumentMetadata.d.ts +0 -6
- package/es5/index.d.ts +0 -10
- package/es5/index.js +0 -1694
- package/es5/index.mjs +0 -1672
- package/es5/mergeFields.d.ts +0 -8
- package/es5/package.json +0 -39
- package/es5/prepareGatewayDocument.d.ts +0 -2
- package/es5/resolveExternalValue.d.ts +0 -3
- package/es5/subschemaConfig.d.ts +0 -3
- package/es5/symbols.d.ts +0 -3
- package/es5/types.d.ts +0 -149
- package/mergeFields.d.ts +0 -8
- package/resolveExternalValue.d.ts +0 -3
package/Subschema.d.ts
CHANGED
|
@@ -2,10 +2,7 @@ import { GraphQLSchema } from 'graphql';
|
|
|
2
2
|
import { SubschemaConfig, Transform, MergedTypeConfig, CreateProxyingResolverFn, BatchingOptions } from './types';
|
|
3
3
|
import { Executor } from '@graphql-tools/utils';
|
|
4
4
|
export declare function isSubschema(value: any): value is Subschema;
|
|
5
|
-
|
|
6
|
-
transformedSchema: GraphQLSchema;
|
|
7
|
-
}
|
|
8
|
-
export declare class Subschema<K = any, V = any, C = K, TContext = Record<string, any>> implements ISubschema<K, V, C, TContext> {
|
|
5
|
+
export declare class Subschema<K = any, V = any, C = K, TContext = Record<string, any>> implements SubschemaConfig<K, V, C, TContext> {
|
|
9
6
|
schema: GraphQLSchema;
|
|
10
7
|
executor?: Executor<TContext>;
|
|
11
8
|
batch?: boolean;
|
|
@@ -13,7 +10,6 @@ export declare class Subschema<K = any, V = any, C = K, TContext = Record<string
|
|
|
13
10
|
createProxyingResolver?: CreateProxyingResolverFn<TContext>;
|
|
14
11
|
transforms: Array<Transform<any, TContext>>;
|
|
15
12
|
transformedSchema: GraphQLSchema;
|
|
16
|
-
merge?: Record<string, MergedTypeConfig<any,
|
|
13
|
+
merge?: Record<string, MergedTypeConfig<any, TContext>>;
|
|
17
14
|
constructor(config: SubschemaConfig<K, V, C, TContext>);
|
|
18
15
|
}
|
|
19
|
-
export {};
|
package/Transformer.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ export declare class Transformer<TContext = Record<string, any>> {
|
|
|
6
6
|
constructor(context: DelegationContext<TContext>);
|
|
7
7
|
private addTransform;
|
|
8
8
|
transformRequest(originalRequest: ExecutionRequest): ExecutionRequest;
|
|
9
|
-
transformResult(originalResult: ExecutionResult):
|
|
9
|
+
transformResult(originalResult: ExecutionResult): ExecutionResult;
|
|
10
10
|
}
|
|
@@ -4,6 +4,8 @@ import { ExternalObject } from './types';
|
|
|
4
4
|
* Resolver that knows how to:
|
|
5
5
|
* a) handle aliases for proxied schemas
|
|
6
6
|
* b) handle errors from proxied schemas
|
|
7
|
-
* c) handle external to internal enum conversion
|
|
7
|
+
* c) handle external to internal enum/scalar conversion
|
|
8
|
+
* d) handle type merging
|
|
9
|
+
* e) handle deferred values
|
|
8
10
|
*/
|
|
9
11
|
export declare function defaultMergedResolver(parent: ExternalObject, args: Record<string, any>, context: Record<string, any>, info: GraphQLResolveInfo): any;
|
package/delegateToSchema.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { GraphQLSchema } from 'graphql';
|
|
1
|
+
import { GraphQLSchema, DocumentNode } from 'graphql';
|
|
2
2
|
import { Executor } from '@graphql-tools/utils';
|
|
3
|
-
import { IDelegateToSchemaOptions, IDelegateRequestOptions } from './types';
|
|
3
|
+
import { IDelegateToSchemaOptions, IDelegateRequestOptions, DelegationContext } from './types';
|
|
4
4
|
export declare function delegateToSchema<TContext = Record<string, any>, TArgs = any>(options: IDelegateToSchemaOptions<TContext, TArgs>): any;
|
|
5
5
|
export declare function delegateRequest<TContext = Record<string, any>, TArgs = any>(options: IDelegateRequestOptions<TContext, TArgs>): any;
|
|
6
|
+
export declare function getDelegationContext<TContext>({ request, schema, fieldName, returnType, args, info, transforms, transformedSchema, }: IDelegateRequestOptions<TContext>): DelegationContext<TContext>;
|
|
7
|
+
export declare function validateRequest(delegationContext: DelegationContext<any>, document: DocumentNode): void;
|
|
8
|
+
export declare function getExecutor<TContext>(delegationContext: DelegationContext<TContext>): Executor<TContext>;
|
|
6
9
|
export declare const createDefaultExecutor: (schema: GraphQLSchema) => Executor;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GraphQLError, GraphQLFieldMap, GraphQLResolveInfo, GraphQLSchema } from 'graphql';
|
|
2
|
+
import { ExternalObject, SubschemaConfig } from './types';
|
|
3
|
+
export declare function isExternalObject(data: any): data is ExternalObject;
|
|
4
|
+
export declare function annotateExternalObject<TContext = Record<string, any>>(object: any, errors: Array<GraphQLError>, initialPath: Array<string | number>, subschema: GraphQLSchema | SubschemaConfig<any, any, any, TContext>, info?: GraphQLResolveInfo): ExternalObject;
|
|
5
|
+
export declare function getInitialPath(object: ExternalObject): Array<string | number>;
|
|
6
|
+
export declare function getInitialPossibleFields(object: ExternalObject): GraphQLFieldMap<any, any>;
|
|
7
|
+
export declare function getInfo(object: ExternalObject): GraphQLResolveInfo;
|
|
8
|
+
export declare function getUnpathedErrors(object: ExternalObject): Array<GraphQLError>;
|
|
9
|
+
export declare function getObjectSubchema(object: ExternalObject): GraphQLSchema | SubschemaConfig;
|
|
10
|
+
export declare function getSubschemaMap(object: ExternalObject): Record<string, GraphQLSchema | SubschemaConfig>;
|
|
11
|
+
export declare function getSubschema(object: ExternalObject, responseKey: string): GraphQLSchema | SubschemaConfig;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { GraphQLResolveInfo, GraphQLError, GraphQLSchema, GraphQLOutputType } from 'graphql';
|
|
2
|
+
import { ExternalValueFromResultOptions, SubschemaConfig } from './types';
|
|
3
|
+
export declare function externalValueFromResult<TContext = Record<string, any>>({ result, schema, info, context, fieldName, returnType, onLocatedError, }: ExternalValueFromResultOptions<TContext>): any;
|
|
4
|
+
export declare function createExternalValue<TContext = Record<string, any>>(data: any, unpathedErrors: Array<GraphQLError>, initialPath: Array<string | number>, subschema: GraphQLSchema | SubschemaConfig<any, any, any, TContext>, context?: TContext, info?: GraphQLResolveInfo, returnType?: GraphQLOutputType): any;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FieldNode, GraphQLResolveInfo, GraphQLSchema } from 'graphql';
|
|
2
|
+
import { ExternalObject, MergedTypeInfo } from './types';
|
|
3
|
+
import { Subschema } from './Subschema';
|
|
4
|
+
export declare function getMergedParent(parent: ExternalObject, context: Record<string, any>, info: GraphQLResolveInfo): Promise<ExternalObject>;
|
|
5
|
+
export declare const buildDelegationPlan: (mergedTypeInfo: MergedTypeInfo, gatewaySchema: GraphQLSchema, sourceSubschema: Subschema, ...fieldNodeArrays: Array<ReadonlyArray<FieldNode>>) => {
|
|
6
|
+
requiredKeys: Record<string, Set<string>>;
|
|
7
|
+
delegationMaps: Array<Map<Subschema, Array<FieldNode>>>;
|
|
8
|
+
stageMap: Record<string, number>;
|
|
9
|
+
};
|
package/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ export * from './applySchemaTransforms';
|
|
|
4
4
|
export * from './createRequest';
|
|
5
5
|
export * from './defaultMergedResolver';
|
|
6
6
|
export * from './delegateToSchema';
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
7
|
+
export * from './getMergedParent';
|
|
8
|
+
export * from './externalObjects';
|
|
9
|
+
export * from './externalValues';
|
|
9
10
|
export * from './subschemaConfig';
|
|
10
11
|
export * from './types';
|