@graphql-mesh/utils

Type aliases#

Variables#

Functions#

Type aliases#

ArgTypeMap#

Ƭ ArgTypeMap: { [argName: string]: GraphQLInputType | ArgType; }

Defined in: packages/utils/src/resolver-data-factory.ts:17


ResolverDataBasedFactory#

Ƭ ResolverDataBasedFactory<T\>: (data: ResolverData) => T

Type parameters:#

Name
T

Defined in: packages/utils/src/resolver-data-factory.ts:15

Variables#

stringInterpolator#

Const stringInterpolator: any

Defined in: packages/utils/src/string-interpolator.ts:5

Functions#

applyRequestTransforms#

applyRequestTransforms(originalRequest: Request, delegationContext: DelegationContext, transformationContext: Record<string, any\>, transforms: Transform[]): Request

Parameters:#

NameType
originalRequestRequest
delegationContextDelegationContext
transformationContextRecord<string, any\>
transformsTransform[]

Returns: Request

Defined in: packages/utils/src/apply-transforms.ts:17


applyResultTransforms#

applyResultTransforms(originalResult: ExecutionResult, delegationContext: DelegationContext, transformationContext: Record<string, any\>, transforms: Transform[]): ExecutionResult<Record<string, any\>\>

Parameters:#

NameType
originalResultExecutionResult
delegationContextDelegationContext
transformationContextRecord<string, any\>
transformsTransform[]

Returns: ExecutionResult<Record<string, any\>\>

Defined in: packages/utils/src/apply-transforms.ts:41


applySchemaTransforms#

applySchemaTransforms(originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig, transformedSchema: GraphQLSchema, transforms: Transform[]): GraphQLSchema

Parameters:#

NameType
originalWrappingSchemaGraphQLSchema
subschemaConfigSubschemaConfig
transformedSchemaGraphQLSchema
transformsTransform[]

Returns: GraphQLSchema

Defined in: packages/utils/src/apply-transforms.ts:5


ensureDocumentNode#

ensureDocumentNode<TData, TVariables\>(document: GraphQLOperation<TData, TVariables\>): TypedDocumentNode<TData, TVariables\>

Type parameters:#

NameDefault
TDataany
TVariablesany

Parameters:#

NameType
documentGraphQLOperation<TData, TVariables\>

Returns: TypedDocumentNode<TData, TVariables\>

Defined in: packages/utils/src/ensure-document-node.ts:5


extractResolvers#

extractResolvers(schema: GraphQLSchema): any

Parameters:#

NameType
schemaGraphQLSchema

Returns: any

Defined in: packages/utils/src/extract-resolvers.ts:4


getHeadersObject#

getHeadersObject(headers: Headers): Record<string, string\>

Parameters:#

NameType
headersHeaders

Returns: Record<string, string\>

Defined in: packages/utils/src/resolver-data-factory.ts:93


getInputTypeFromTypeName#

getInputTypeFromTypeName(typeName: GraphQLInputType | ArgType): GraphQLInputType

Parameters:#

NameType
typeNameGraphQLInputType

Returns: GraphQLInputType

Defined in: packages/utils/src/resolver-data-factory.ts:27


getInterpolatedHeadersFactory#

getInterpolatedHeadersFactory(nonInterpolatedHeaders?: Record<string, string\>): ResolverDataBasedFactory<Headers\>

Parameters:#

NameTypeDefault value
nonInterpolatedHeadersRecord<string, string\>...

Returns: ResolverDataBasedFactory<Headers\>

Defined in: packages/utils/src/resolver-data-factory.ts:78


getInterpolatedStringFactory#

getInterpolatedStringFactory(nonInterpolatedString: string): ResolverDataBasedFactory<string\>

Parameters:#

NameType
nonInterpolatedStringstring

Returns: ResolverDataBasedFactory<string\>

Defined in: packages/utils/src/resolver-data-factory.ts:74


groupTransforms#

groupTransforms(transforms: MeshTransform[]): object

Parameters:#

NameType
transformsMeshTransform[]

Returns: object

NameType
noWrapTransformsMeshTransform[]
wrapTransformsMeshTransform[]

Defined in: packages/utils/src/group-transforms.ts:3


isUrl#

isUrl(string: string): boolean

Parameters:#

NameType
stringstring

Returns: boolean

Defined in: node_modules/@types/is-url/index.d.ts:9


loadFromModuleExportExpression#

loadFromModuleExportExpression<T\>(expression: T | string, defaultExportName?: string): Promise<T\>

Type parameters:#

Name
T

Parameters:#

NameType
expressionT
defaultExportName?string

Returns: Promise<T\>

Defined in: packages/utils/src/load-from-module-export-expression.ts:3


loadFromModuleExportExpressionSync#

loadFromModuleExportExpressionSync<T\>(expression: T | string, defaultExportName?: string): T

Type parameters:#

Name
T

Parameters:#

NameType
expressionT
defaultExportName?string

Returns: T

Defined in: packages/utils/src/load-from-module-export-expression.ts:40


mkdir#

mkdir(path: string, options?: MakeDirectoryOptions): Promise<void\>

Parameters:#

NameType
pathstring
options?MakeDirectoryOptions

Returns: Promise<void\>

Defined in: packages/utils/src/fs-operations.ts:41


parseInterpolationStrings#

parseInterpolationStrings(interpolationStrings: string[], argTypeMap?: ArgTypeMap): object

Parameters:#

NameType
interpolationStringsstring[]
argTypeMap?ArgTypeMap

Returns: object

NameType
argsGraphQLFieldConfigArgumentMap
contextVariablesstring[]

Defined in: packages/utils/src/resolver-data-factory.ts:46


pathExists#

pathExists(path: string): Promise<boolean\>

Parameters:#

NameType
pathstring

Returns: Promise<boolean\>

Defined in: packages/utils/src/fs-operations.ts:5


readFileOrUrlWithCache#

readFileOrUrlWithCache<T\>(filePathOrUrl: string, cache: KeyValueCache, config?: ReadFileOrUrlOptions): Promise<T\>

Type parameters:#

Name
T

Parameters:#

NameType
filePathOrUrlstring
cacheKeyValueCache
config?ReadFileOrUrlOptions

Returns: Promise<T\>

Defined in: packages/utils/src/read-file-or-url.ts:16


readFileWithCache#

readFileWithCache<T\>(filePath: string, cache: KeyValueCache, config?: ReadFileOrUrlOptions): Promise<T\>

Type parameters:#

Name
T

Parameters:#

NameType
filePathstring
cacheKeyValueCache
config?ReadFileOrUrlOptions

Returns: Promise<T\>

Defined in: packages/utils/src/read-file-or-url.ts:28


readJSON#

readJSON(path: string): Promise<any\>

Parameters:#

NameType
pathstring

Returns: Promise<any\>

Defined in: packages/utils/src/fs-operations.ts:26


readJSONSync#

readJSONSync(path: string): any

Parameters:#

NameType
pathstring

Returns: any

Defined in: packages/utils/src/fs-operations.ts:21


readUrlWithCache#

readUrlWithCache<T\>(path: string, cache: KeyValueCache, config?: ReadFileOrUrlOptions): Promise<T\>

Type parameters:#

Name
T

Parameters:#

NameType
pathstring
cacheKeyValueCache
config?ReadFileOrUrlOptions

Returns: Promise<T\>

Defined in: packages/utils/src/read-file-or-url.ts:66


withCancel#

withCancel<T\>(asyncIteratorLike: { [Symbol.asyncIterator]: () => AsyncIterator<T, any, undefined\> }, onCancel: () => void): AsyncIterator<T | undefined\>

Type parameters:#

Name
T

Parameters:#

NameType
asyncIteratorLike{ [Symbol.asyncIterator]: () => AsyncIterator<T, any, undefined\> }
onCancel() => void

Returns: AsyncIterator<T | undefined\>

Defined in: packages/utils/src/with-cancel.ts:1


writeJSON#

writeJSON<T\>(path: string, data: T, replacer?: (this: any, key: string, value: any) => any, space?: string | number): Promise<void\>

Type parameters:#

Name
T

Parameters:#

NameType
pathstring
dataT
replacer?(this: any, key: string, value: any) => any
space?string

Returns: Promise<void\>

Defined in: packages/utils/src/fs-operations.ts:31