The Guild LogoThe Guild Monogram

Search docs

Search icon

Products by The Guild

Products

Hive logoHive blurred logo

Hive

Schema Registry for your GraphQL Workflows

Skip to main content

@graphql-mesh/utils

Interfaces#

Type aliases#

Variables#

Functions#

Type aliases#

ResolverDataBasedFactory#

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

Type parameters#

Name
T

Type declaration#

▸ (data): T

Parameters#
NameType
dataResolverData
Returns#

T

Defined in#

packages/utils/src/resolver-data-factory.ts:5

Variables#

AggregateError#

Let AggregateError: AggregateErrorConstructor

Defined in#

node_modules/@graphql-tools/utils/AggregateError.d.ts:9


globalLruCache#

Const globalLruCache: Lru<any\>

Defined in#

packages/utils/src/global-lru-cache.ts:3


stringInterpolator#

Const stringInterpolator: any

Defined in#

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

Functions#

applyRequestTransforms#

applyRequestTransforms(originalRequest, delegationContext, transformationContext, transforms): ExecutionRequest<Record<string, any\>, any, any, Record<string, any\>\>

Parameters#

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

Returns#

ExecutionRequest<Record<string, any\>, any, any, Record<string, any\>\>

Defined in#

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


applyResultTransforms#

applyResultTransforms(originalResult, delegationContext, transformationContext, transforms): 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, subschemaConfig, transformedSchema, transforms): GraphQLSchema

Parameters#

NameType
originalWrappingSchemaGraphQLSchema
subschemaConfigSubschemaConfig
transformedSchemaGraphQLSchema
transformsTransform[]

Returns#

GraphQLSchema

Defined in#

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


asArray#

Const asArray<T\>(maybeArray): T[]

Type parameters#

Name
T

Parameters#

NameType
maybeArrayT | T[]

Returns#

T[]

Defined in#

packages/utils/src/as-array.ts:1


ensureDocumentNode#

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

Type parameters#

NameType
TDataTData = any
TVariablesTVariables = any

Parameters#

NameType
documentGraphQLOperation<TData, TVariables\>

Returns#

TypedDocumentNode<TData, TVariables\>

Defined in#

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


extractResolvers#

extractResolvers(schema): any

Parameters#

NameType
schemaGraphQLSchema

Returns#

any

Defined in#

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


flatString#

flatString(str): string

Parameters#

NameType
strstring

Returns#

string

Defined in#

packages/utils/src/flat-string.ts:2


getCachedFetch#

getCachedFetch(cache): typeof fetch

Parameters#

NameType
cacheKeyValueCache

Returns#

typeof fetch

Defined in#

packages/utils/src/read-file-or-url.ts:19


getDefaultImport#

getDefaultImport(baseDir): ImportFn

Parameters#

NameType
baseDirstring

Returns#

ImportFn

Defined in#

packages/utils/src/load-from-module-export-expression.ts:95


getDefaultSyncImport#

getDefaultSyncImport(baseDir): SyncImportFn

Parameters#

NameType
baseDirstring

Returns#

SyncImportFn

Defined in#

packages/utils/src/load-from-module-export-expression.ts:100


getHeadersObject#

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

Parameters#

NameType
headersHeaders

Returns#

Record<string, string\>

Defined in#

packages/utils/src/resolver-data-factory.ts:54


getInterpolatedHeadersFactory#

getInterpolatedHeadersFactory(nonInterpolatedHeaders?): ResolverDataBasedFactory<Headers\>

Parameters#

NameType
nonInterpolatedHeadersRecord<string, string\>

Returns#

ResolverDataBasedFactory<Headers\>

Defined in#

packages/utils/src/resolver-data-factory.ts:39


getInterpolatedStringFactory#

getInterpolatedStringFactory(nonInterpolatedString): ResolverDataBasedFactory<string\>

Parameters#

NameType
nonInterpolatedStringstring

Returns#

ResolverDataBasedFactory<string\>

Defined in#

packages/utils/src/resolver-data-factory.ts:35


groupTransforms#

groupTransforms(transforms): Object

Parameters#

NameType
transformsMeshTransform[]

Returns#

Object

NameType
noWrapTransformsMeshTransform[]
wrapTransformsMeshTransform[]

Defined in#

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


hashObject#

hashObject(value): string

Parameters#

NameType
valueany

Returns#

string

Defined in#

packages/utils/src/hashObject.ts:3


isUrl#

isUrl(string): boolean

Parameters#

NameType
stringstring

Returns#

boolean

Whether string is a URL.

Defined in#

node_modules/@types/is-url/index.d.ts:12


jitExecutorFactory#

Const jitExecutorFactory(schema, prefix, logger): (__namedParameters: ExecutionRequest<Record<string, any\>, any, any, Record<string, any\>\>) => ExecutionResult<Object, Object\> | Promise<ExecutionResult<Object, Object\> | AsyncIterableIterator<ExecutionResult<Object, Object\>\>\>

Parameters#

NameType
schemaGraphQLSchema
prefixstring
loggerLogger

Returns#

fn

▸ (__namedParameters): ExecutionResult<Object, Object\> | Promise<ExecutionResult<Object, Object\> | AsyncIterableIterator<ExecutionResult<Object, Object\>\>\>

Parameters#
NameType
__namedParametersExecutionRequest<Record<string, any\>, any, any, Record<string, any\>\>
Returns#

ExecutionResult<Object, Object\> | Promise<ExecutionResult<Object, Object\> | AsyncIterableIterator<ExecutionResult<Object, Object\>\>\>

Defined in#

packages/utils/src/jitExecute.ts:9


jsonFlatStringify#

jsonFlatStringify<T\>(data, replacer?, space?): string

Type parameters#

Name
T

Parameters#

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

Returns#

string

Defined in#

packages/utils/src/flat-string.ts:6


loadFromModuleExportExpression#

loadFromModuleExportExpression<T\>(expression, options): Promise<T\>

Type parameters#

Name
T

Parameters#

NameType
expressionT | string
optionsLoadFromModuleExportExpressionOptions

Returns#

Promise<T\>

Defined in#

packages/utils/src/load-from-module-export-expression.ts:13


loadFromModuleExportExpressionSync#

loadFromModuleExportExpressionSync<T\>(expression, options): T

Type parameters#

Name
T

Parameters#

NameType
expressionT | string
optionsLoadFromModuleExportExpressionSyncOptions

Returns#

T

Defined in#

packages/utils/src/load-from-module-export-expression.ts:60


mkdir#

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

Parameters#

NameType
pathstring
optionsMakeDirectoryOptions

Returns#

Promise<void\>

Defined in#

packages/utils/src/fs-operations.ts:53


parseInterpolationStrings#

parseInterpolationStrings(interpolationStrings, argTypeMap?): Object

Parameters#

NameType
interpolationStringsstring[]
argTypeMap?Record<string, string\>

Returns#

Object

NameType
argsRecord<string, Object\>
contextVariablesstring[]

Defined in#

packages/utils/src/resolver-data-factory.ts:7


pathExists#

pathExists(path): Promise<boolean\>

Parameters#

NameType
pathstring

Returns#

Promise<boolean\>

Defined in#

packages/utils/src/fs-operations.ts:7


readFileOrUrlWithCache#

readFileOrUrlWithCache<T\>(filePathOrUrl, cache, config?): 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:28


readFileWithCache#

readFileWithCache<T\>(filePath, cache, config?): 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:40


readJSON#

readJSON<T\>(path): Promise<T\>

Type parameters#

NameType
TT = any

Parameters#

NameType
pathstring

Returns#

Promise<T\>

Defined in#

packages/utils/src/fs-operations.ts:28


readJSONSync#

readJSONSync<T\>(path): T

Type parameters#

NameType
TT = any

Parameters#

NameType
pathstring

Returns#

T

Defined in#

packages/utils/src/fs-operations.ts:23


readUrlWithCache#

readUrlWithCache<T\>(path, cache, config?): 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:85


resolveAdditionalResolvers#

resolveAdditionalResolvers(baseDir, additionalResolvers, importFn, pubsub): Promise<IResolvers[]\>

Parameters#

NameType
baseDirstring
additionalResolvers(string | AdditionalStitchingResolverObject | AdditionalSubscriptionObject | AdditionalStitchingBatchResolverObject)[]
importFnImportFn
pubsubMeshPubSub

Returns#

Promise<IResolvers[]\>

Defined in#

packages/utils/src/resolve-additional-resolvers.ts:137


rmdirs#

rmdirs(dir): Promise<void\>

Parameters#

NameType
dirstring

Returns#

Promise<void\>

Defined in#

packages/utils/src/fs-operations.ts:60


sanitizeNameForGraphQL#

sanitizeNameForGraphQL(unsafeName): string

Parameters#

NameType
unsafeNamestring

Returns#

string

Defined in#

packages/utils/src/sanitize-name-for-graphql.ts:40


withCancel#

withCancel<T\>(asyncIteratorLike, onCancel): AsyncIterator<T | undefined\>

Type parameters#

Name
T

Parameters#

NameType
asyncIteratorLikeObject
asyncIteratorLike.[asyncIterator]
onCancel() => void

Returns#

AsyncIterator<T | undefined\>

Defined in#

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


writeFile#

Const writeFile(path, data, options?): Promise<void\>

Parameters#

NameType
pathPathLike | FileHandle
datastring | Uint8Array
options?BaseEncodingOptions & { flag?: OpenMode ; mode?: Mode } | BufferEncoding | null

Returns#

Promise<void\>

Defined in#

packages/utils/src/fs-operations.ts:43


writeJSON#

writeJSON<T\>(path, data, replacer?, space?): Promise<void\>

Type parameters#

Name
T

Parameters#

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

Returns#

Promise<void\>

Defined in#

packages/utils/src/fs-operations.ts:33