Skip to main content

sdk

Index

Namespaces

Enumerations

ExtensionVersion

Enumeration Members

Enumeration MemberValue

V1

"v1"

Classes

Extension

Constructors

new Extension()

new Extension(): Extension

Returns

Extension

Properties

PropertyTypeDefault value

version

V1

ExtensionVersion.V1

Methods

build()

build(module, mapper): void

Parameters
ParameterType

module

ModuleBuilder

mapper

ResolverMapper

Returns

void

getModuleExtensions()

getModuleExtensions(): object

Returns

object

getResolverExtensions()

getResolverExtensions<Result, Root, Context, Args>(module, type, field): object

Type Parameters
Type Parameter

Result

Root

Context

Args

Parameters
ParameterType

module

ModuleBuilder

type

string

field

string

Returns

object

getSubscriptionExtensions()

getSubscriptionExtensions<Root, Context, Args>(module, field): object

Type Parameters
Type Parameter

Root

Context

Args

Parameters
ParameterType

module

ModuleBuilder

field

string

Returns

object

getSubscriptionResolveExtensions()

getSubscriptionResolveExtensions<Result, Root, Context, Args>(module, field): object

Type Parameters
Type Parameter

Result

Root

Context

Args

Parameters
ParameterType

module

ModuleBuilder

field

string

Returns

object

getSubscriptionSubscribeExtensions()

getSubscriptionSubscribeExtensions<Iterator, Root, Context, Args>(module, field): object

Type Parameters
Type Parameter

Iterator

Root

Context

Args

Parameters
ParameterType

module

ModuleBuilder

field

string

Returns

object

getTransformers()

getTransformers(): SchemaTransformer[]

Returns

SchemaTransformer[]

getTypeExtensions()

getTypeExtensions<Result, Context>(module, type): object

Type Parameters
Type Parameter

Result

Context

Parameters
ParameterType

module

ModuleBuilder

type

string

Returns

object


ModuleBuilder

Constructors

new ModuleBuilder()

new ModuleBuilder(id, dirname, hashes, typedef, extensions): ModuleBuilder

Parameters
ParameterType

id

string

dirname

string

hashes

TypeHashMap

typedef

DocumentNode

extensions

Extension[]

Returns

ModuleBuilder

Properties

PropertyModifierTypeDefault value

dirname

readonly

string

undefined

hashes

readonly

TypeHashMap

undefined

id

readonly

string

undefined

mapper

readonly

ResolverMapper

undefined

transformers

readonly

SchemaTransformer[]

[]

typedef

readonly

DocumentNode

undefined

Methods

build()

build(): object

Returns

object

NameType
resolversIResolvers
transform(schema) => GraphQLSchema
typedefDocumentNode
createMiddlewareBuilder()

createMiddlewareBuilder<Result, Root, Context, Args>(type, field): (middleware) => void

Type Parameters
Type Parameter

Result

Root

Context

Args

Parameters
ParameterType

type

string

field

string

Returns

Function

Parameters
ParameterType

middleware

Middleware<Result, Root, Context, Args>

Returns

void

createModuleMethods()

createModuleMethods<Context>(): ModuleExtensions & object

Type Parameters
Type Parameter

Context

Returns

ModuleExtensions & object

createResolverBuilder()

createResolverBuilder<Result, Root, Context, Args>(type, field): (resolver) => void & ResolverExtensions<Result, Root, Context, Args> & object

Type Parameters
Type Parameter

Result

Root

Context

Args

Parameters
ParameterType

type

string

field

string

Returns

(resolver) => void & ResolverExtensions<Result, Root, Context, Args> & object

createResolveType()

createResolveType<Result, Value, Context>(type): (resolver) => void

Type Parameters
Type Parameter

Result

Value

Context

Parameters
ParameterType

type

string

Returns

Function

Parameters
ParameterType

resolver

TypeResolver<Result, Value, Context>

Returns

void

createScalarBuilder()

createScalarBuilder(scalar): (resolver) => void

Parameters
ParameterType

scalar

string

Returns

Function

Parameters
ParameterType

resolver

ScalarResolver

Returns

void

createSubscriptionBuilder()

createSubscriptionBuilder<Result, Root, Context, Args>(field): <Payload>(subscription) => void & object

Type Parameters
Type Parameter

Result

Root

Context

Args

Parameters
ParameterType

field

string

Returns

<Payload>(subscription) => void & object

createSubscriptionMethods()

createSubscriptionMethods<Root, Context>(): TypeExtensions<Root, Context> & object & object

Type Parameters
Type Parameter

Root

Context

Returns

TypeExtensions<Root, Context> & object & object

createTypeMethods()

createTypeMethods<Root, Context>(type): TypeExtensions<Root, Context> & object

Type Parameters
Type Parameter

Root

Context

Parameters
ParameterType

type

string

Returns

TypeExtensions<Root, Context> & object


ResolverMapper

Constructors

new ResolverMapper()

new ResolverMapper(): ResolverMapper

Returns

ResolverMapper

Properties

PropertyModifierTypeDefault value

middlewares

readonly

MiddlewareMap

undefined

prependedMiddlewares

readonly

MiddlewareMap

undefined

resolvers

readonly

ResolversMap

undefined

scalars

readonly

ScalarsMap

undefined

typeFields

readonly

Record<string, undefined | string[]>

undefined

types

readonly

string[]

[]

Methods

addMiddleware()

addMiddleware<Result, Root, Context, Args>(type, field, middleware): void

Type Parameters
Type Parameter

Result

Root

Context

Args

Parameters
ParameterType

type

string

field

string

middleware

NativeMiddleware<Result, Root, Context, Args>

Returns

void

addMiddlewareToMap()

protected addMiddlewareToMap<Result, Root, Context, Args>(map, type, field, middleware): void

Type Parameters
Type Parameter

Result

Root

Context

Args

Parameters
ParameterType

map

MiddlewareMap

type

string

field

string

middleware

NativeMiddleware<Result, Root, Context, Args>

Returns

void

compose()

compose(): IResolvers

Returns

IResolvers

getTypeFields()

getTypeFields(type): string[]

Parameters
ParameterType

type

string

Returns

string[]

getTypes()

getTypes(): string[]

Returns

string[]

prependMiddleware()

prependMiddleware<Result, Root, Context, Args>(type, field, middleware): void

Type Parameters
Type Parameter

Result

Root

Context

Args

Parameters
ParameterType

type

string

field

string

middleware

NativeMiddleware<Result, Root, Context, Args>

Returns

void

registerTypeField()

registerTypeField(type, field): void

Parameters
ParameterType

type

string

field

string

Returns

void

setDefaultFieldResolver()

setDefaultFieldResolver(type, field): void

Parameters
ParameterType

type

string

field

string

Returns

void

setResolver()

setResolver<Result, Root, Context, Args>(type, field, resolver): void

Type Parameters
Type Parameter

Result

Root

Context

Args

Parameters
ParameterType

type

string

field

string

resolver

NativeResolver<Result, Root, Context, Args>

Returns

void

setScalar()

setScalar(scalar, resolver): void

Parameters
ParameterType

scalar

string

resolver

ScalarResolver

Returns

void

setSubscription()

setSubscription<Payload, Result, Root, Context, Args>(field, resolver): void

Type Parameters
Type Parameter

Payload

Result

Root

Context

Args

Parameters
ParameterType

field

string

resolver

NativeSubscription<Payload, Result, Root, Context, Args>

Returns

void

setTypenameResolver()

setTypenameResolver<Result, Value, Context>(type, resolver): void

Type Parameters
Type Parameter

Result

Value

Context

Parameters
ParameterType

type

string

resolver

NativeTypeResolver<Result, Value, Context>

Returns

void

Interfaces

Module<T>

Type Parameters

Type Parameter

T

Properties

PropertyType

createManager

(builder: ModuleBuilder) => T

dirname

string

hashes

TypeHashMap

id

string

typedef

DocumentNode

Type Aliases

ExtensionFactory()<E>

ExtensionFactory<E>: () => E

Type Parameters

Type Parameter

E extends Extension

Returns

E


FieldResolvers

FieldResolvers: Record<string, NativeResolver> & object

Type declaration

NameType

__resolveType?

NativeTypeResolver


MiddlewareMap

MiddlewareMap: Record<string, NativeMiddleware[] | undefined>


NativeMiddleware()<Result, Root, Context, Args>

NativeMiddleware<Result, Root, Context, Args>: (next) => GraphQLFieldResolver<Root, Context, Args, Result | PromiseLike<Result>>

Type Parameters

Type ParameterDefault type

Result

unknown

Root

unknown

Context

unknown

Args

unknown

Parameters

ParameterType

next

GraphQLFieldResolver<Root, Context, Args, Result | PromiseLike<Result>>

Returns

GraphQLFieldResolver<Root, Context, Args, Result | PromiseLike<Result>>


NativeResolver<Result, Root, Context, Args>

NativeResolver<Result, Root, Context, Args>: GraphQLFieldResolver<Root, Context, Args, Result>

Type Parameters

Type ParameterDefault type

Result

unknown

Root

unknown

Context

unknown

Args

unknown


NativeSubscription<Payload, Result, Root, Context, Args>

NativeSubscription<Payload, Result, Root, Context, Args>: object

Type Parameters

Type ParameterDefault type

Payload

unknown

Result

unknown

Root

unknown

Context

unknown

Args

unknown

Type declaration

NameType

subscribe

NativeSubscriptionSubscribe<Payload, Root, Context, Args>

resolve?

GraphQLFieldResolver<Payload, Context, Args, Result>


NativeSubscriptionSubscribe()<Payload, Root, Context, Args>

NativeSubscriptionSubscribe<Payload, Root, Context, Args>: (source, args, context, info) => AsyncIterator<Payload> | Promise<AsyncIterator<Payload>>

Type Parameters

Type Parameter

Payload

Root

Context

Args

Parameters

ParameterType

source

Root

args

Args

context

Context

info

GraphQLResolveInfo

Returns

AsyncIterator<Payload> | Promise<AsyncIterator<Payload>>


NativeTypeResolver<Result, Value, Context>

NativeTypeResolver<Result, Value, Context>: GraphQLTypeResolver<Value, Context>

Type Parameters

Type ParameterDefault type

Result

unknown

Value

unknown

Context

unknown


ResolversMap

ResolversMap: object & SubscriptionsResolvers


ScalarsMap

ScalarsMap: Record<string, ScalarResolver | undefined>


SchemaTransformer()

SchemaTransformer: (schema) => GraphQLSchema

Parameters

ParameterType

schema

GraphQLSchema

Returns

GraphQLSchema


SubscriptionsResolvers

SubscriptionsResolvers: object

Type declaration

NameType

Subscription?

Record<string, NativeSubscription | undefined>


TypeHash

TypeHash: object

Type declaration

NameType

fieldsHashes

Record<string, string | undefined>

hash

string


TypeHashMap

TypeHashMap: Record<string, TypeHash | undefined>

Functions

addValidationToSchema()

addValidationToSchema(schema): GraphQLSchema

Parameters

ParameterType

schema

GraphQLSchema

Returns

GraphQLSchema


createMiddlewareAdapter()

createMiddlewareAdapter<Result, Root, Context, Args>(middleware): NativeMiddleware<Result, Root, Context, Args>

Type Parameters

Type Parameter

Result

Root

Context

Args

Parameters

ParameterType

middleware

Middleware<Result, Root, Context, Args>

Returns

NativeMiddleware<Result, Root, Context, Args>


createModuleManager()

createModuleManager<T>(moduleMetadata, extensions?): Omit<T, "$builder">

Type Parameters

Type Parameter

T

Parameters

ParameterType

moduleMetadata

Module<T>

extensions?

ExtensionFactory<Extension>[]

Returns

Omit<T, "$builder">


createObjectLens()

createObjectLens<T>(input, path): object

A lens to get and set values in an object, that fails silently if the path does not exist.

Type Parameters

Type ParameterDefault type

T

unknown

Parameters

ParameterType

input

Record<string, unknown>

path

(string | number)[]

Returns

object

NameType
get() => null | T
set(value) => boolean

createResolverAdapter()

createResolverAdapter<Result, Root, Context, Args>(resolver): NativeResolver<Result | PromiseLike<Result>, Root, Context, Args>

Type Parameters

Type Parameter

Result

Root

Context

Args

Parameters

ParameterType

resolver

Resolver<Result, Root, Context, Args>

Returns

NativeResolver<Result | PromiseLike<Result>, Root, Context, Args>


createSingletonModule()

createSingletonModule<T>(create): () => T

Type Parameters

Type Parameter

T

Parameters

ParameterType

create

() => T

Returns

Function

Returns

T


createSubscriptionAdapter()

createSubscriptionAdapter<Payload, Result, Root, Context, Args>(subscription): NativeSubscription<Payload, Result, Root, Context, Args>

Type Parameters

Type Parameter

Payload

Result

Root

Context

Args

Parameters

ParameterType

subscription

Subscription<Payload, Result, Root, Context, Args>

Returns

NativeSubscription<Payload, Result, Root, Context, Args>


createTypeResolverAdapter()

createTypeResolverAdapter<Result, Value, Context>(resolver): NativeTypeResolver<Result, Value, Context>

Type Parameters

Type Parameter

Result

Value

Context

Parameters

ParameterType

resolver

TypeResolver<Result, Value, Context>

Returns

NativeTypeResolver<Result, Value, Context>


extendFunction()

extendFunction<B, M>(fn, ext): B & M

Type Parameters

Type Parameter

B extends (...args) => any

M extends object

Parameters

ParameterType

fn

B

ext

M

Returns

B & M


getModuleBuilder()

getModuleBuilder(module): ModuleBuilder

Parameters

ParameterType

module

Record<string, unknown>

Returns

ModuleBuilder


mergeExtensions()

mergeExtensions<T, K>(items, callback): Record<string, unknown>

Type Parameters

Type Parameter

T

K extends Record<string, unknown>

Parameters

ParameterType

items

T[]

callback

(item) => K

Returns

Record<string, unknown>


mergeMiddlewareMaps()

mergeMiddlewareMaps(target, source): MiddlewareMap

Parameters

ParameterType

target

MiddlewareMap

source

MiddlewareMap

Returns

MiddlewareMap


nameFunction()

nameFunction(fn, name): void

Parameters

ParameterType

fn

(...args) => any

name

string

Returns

void


resolveExtensions()

resolveExtensions<T>(list): T[]

Type Parameters

Type Parameter

T

Parameters

ParameterType

list

() => T[]

Returns

T[]


transformSchema()

transformSchema(schema, transformers): GraphQLSchema

Parameters

ParameterType

schema

GraphQLSchema

transformers

SchemaTransformer[]

Returns

GraphQLSchema


withExtensions()

withExtensions<Core, Ext>(core, ext): Ext & Core

Type Parameters

Type Parameter

Core

Ext

Parameters

ParameterType

core

Core

ext

Ext

Returns

Ext & Core