@graphql-tools/delegate
Advanced tools
Comparing version 6.0.8-alpha-818e986.0 to 6.0.8-alpha-df3e4cf.0
@@ -626,2 +626,20 @@ 'use strict'; | ||
} | ||
function isSubschemaConfig(value) { | ||
return Boolean(value.schema); | ||
} | ||
function isSubschema(value) { | ||
return Boolean(value.transformedSchema); | ||
} | ||
class Subschema { | ||
constructor(config) { | ||
var _a; | ||
this.schema = config.schema; | ||
this.executor = config.executor; | ||
this.subscriber = config.subscriber; | ||
this.createProxyingResolver = config.createProxyingResolver; | ||
this.transforms = (_a = config.transforms) !== null && _a !== void 0 ? _a : []; | ||
this.merge = config.merge; | ||
this.transformedSchema = utils.applySchemaTransforms(this.schema, this.transforms); | ||
} | ||
} | ||
@@ -777,6 +795,2 @@ function unwrapResult(parent, path) { | ||
function isSubschemaConfig(value) { | ||
return Boolean(value.schema); | ||
} | ||
function handleObject(type, object, errors, subschema, context, info, skipTypeMerging) { | ||
@@ -1364,2 +1378,3 @@ var _a; | ||
exports.ReplaceFieldWithFragment = ReplaceFieldWithFragment; | ||
exports.Subschema = Subschema; | ||
exports.checkResultAndHandleErrors = checkResultAndHandleErrors; | ||
@@ -1374,3 +1389,4 @@ exports.createMergedResolver = createMergedResolver; | ||
exports.handleResult = handleResult; | ||
exports.isSubschema = isSubschema; | ||
exports.isSubschemaConfig = isSubschemaConfig; | ||
//# sourceMappingURL=index.cjs.js.map |
@@ -6,4 +6,4 @@ export { delegateToSchema, delegateRequest } from './delegateToSchema'; | ||
export { handleResult } from './results/handleResult'; | ||
export { getSubschema } from './subschema'; | ||
export { Subschema, isSubschema, isSubschemaConfig, getSubschema } from './Subschema'; | ||
export * from './transforms'; | ||
export * from './types'; |
import { visit, visitWithTypeInfo, Kind, getNamedType, isAbstractType, TypeInfo, isObjectType, isInterfaceType, TypeNameMetaFieldDef, getNullableType, isLeafType, isCompositeType, isListType, typeFromAST, isSchema, getOperationAST, validate, execute, subscribe, defaultFieldResolver, parse } from 'graphql'; | ||
import { implementsAbstractType, CombinedError, relocatedError, getErrorsByPathSegment, ERROR_SYMBOL, mergeDeep, getErrors, setErrors, slicedError, collectFields, getResponseKeyFromInfo, updateArgument, serializeInputValue, applyRequestTransforms, applyResultTransforms, mapAsyncIterator, concatInlineFragments } from '@graphql-tools/utils'; | ||
import { implementsAbstractType, CombinedError, relocatedError, getErrorsByPathSegment, applySchemaTransforms, ERROR_SYMBOL, mergeDeep, getErrors, setErrors, slicedError, collectFields, getResponseKeyFromInfo, updateArgument, serializeInputValue, applyRequestTransforms, applyResultTransforms, mapAsyncIterator, concatInlineFragments } from '@graphql-tools/utils'; | ||
@@ -622,2 +622,20 @@ class ExpandAbstractTypes { | ||
} | ||
function isSubschemaConfig(value) { | ||
return Boolean(value.schema); | ||
} | ||
function isSubschema(value) { | ||
return Boolean(value.transformedSchema); | ||
} | ||
class Subschema { | ||
constructor(config) { | ||
var _a; | ||
this.schema = config.schema; | ||
this.executor = config.executor; | ||
this.subscriber = config.subscriber; | ||
this.createProxyingResolver = config.createProxyingResolver; | ||
this.transforms = (_a = config.transforms) !== null && _a !== void 0 ? _a : []; | ||
this.merge = config.merge; | ||
this.transformedSchema = applySchemaTransforms(this.schema, this.transforms); | ||
} | ||
} | ||
@@ -773,6 +791,2 @@ function unwrapResult(parent, path) { | ||
function isSubschemaConfig(value) { | ||
return Boolean(value.schema); | ||
} | ||
function handleObject(type, object, errors, subschema, context, info, skipTypeMerging) { | ||
@@ -1351,3 +1365,3 @@ var _a; | ||
export { AddArgumentsAsVariables, AddFragmentsByField, AddSelectionSetsByType as AddMergedTypeSelectionSets, AddSelectionSetsByField, AddTypenameToAbstract, CheckResultAndHandleErrors, ExpandAbstractTypes, FilterToSchema, ReplaceFieldWithFragment, checkResultAndHandleErrors, createMergedResolver, createRequest, createRequestFromInfo, defaultMergedResolver, delegateRequest, delegateToSchema, getSubschema, handleResult, isSubschemaConfig }; | ||
export { AddArgumentsAsVariables, AddFragmentsByField, AddSelectionSetsByType as AddMergedTypeSelectionSets, AddSelectionSetsByField, AddTypenameToAbstract, CheckResultAndHandleErrors, ExpandAbstractTypes, FilterToSchema, ReplaceFieldWithFragment, Subschema, checkResultAndHandleErrors, createMergedResolver, createRequest, createRequestFromInfo, defaultMergedResolver, delegateRequest, delegateToSchema, getSubschema, handleResult, isSubschema, isSubschemaConfig }; | ||
//# sourceMappingURL=index.esm.js.map |
{ | ||
"name": "@graphql-tools/delegate", | ||
"version": "6.0.8-alpha-818e986.0", | ||
"version": "6.0.8-alpha-df3e4cf.0", | ||
"description": "A set of utils for faster development of GraphQL tools", | ||
@@ -10,4 +10,4 @@ "sideEffects": false, | ||
"dependencies": { | ||
"@graphql-tools/schema": "6.0.8-alpha-818e986.0", | ||
"@graphql-tools/utils": "6.0.8-alpha-818e986.0", | ||
"@graphql-tools/schema": "6.0.8-alpha-df3e4cf.0", | ||
"@graphql-tools/utils": "6.0.8-alpha-df3e4cf.0", | ||
"tslib": "~2.0.0" | ||
@@ -14,0 +14,0 @@ }, |
import { GraphQLSchema, GraphQLOutputType, SelectionSetNode, FieldNode, DocumentNode, GraphQLResolveInfo, GraphQLFieldResolver, InlineFragmentNode, FragmentDefinitionNode, GraphQLObjectType, VariableDefinitionNode } from 'graphql'; | ||
import { Operation, Transform, Request, TypeMap, ExecutionResult } from '@graphql-tools/utils'; | ||
import { Subschema } from './Subschema'; | ||
export interface IDelegateToSchemaOptions<TContext = Record<string, any>, TArgs = Record<string, any>> { | ||
schema: GraphQLSchema | SubschemaConfig; | ||
schema: GraphQLSchema | SubschemaConfig | Subschema; | ||
operation?: Operation; | ||
@@ -85,3 +86,2 @@ fieldName?: string; | ||
export declare type MergedTypeResolver = (originalResult: any, context: Record<string, any>, info: GraphQLResolveInfo, subschema: GraphQLSchema | SubschemaConfig, selectionSet: SelectionSetNode) => any; | ||
export declare function isSubschemaConfig(value: any): value is SubschemaConfig; | ||
export interface StitchingInfo { | ||
@@ -88,0 +88,0 @@ transformedSchemas: Map<GraphQLSchema | SubschemaConfig, GraphQLSchema>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
371735
2972
+ Added@graphql-tools/schema@6.0.8-alpha-df3e4cf.0(transitive)
+ Added@graphql-tools/utils@6.0.8-alpha-df3e4cf.0(transitive)
- Removed@graphql-tools/schema@6.0.8-alpha-818e986.0(transitive)
- Removed@graphql-tools/utils@6.0.8-alpha-818e986.0(transitive)