Skip to main content
Version: 0.6.x

Module: server

ComposeDB server for hybrid execution on the ComposeDB client.

Installation

npm install @composedb/server

Type Aliases

GraphQLParams

Ƭ GraphQLParams<ServerContext>: HandlerParams<ServerContext> & { port?: number | number[] }

Type parameters

NameType
ServerContextextends Record<string, any> = Record<string, any>

GraphQLServer

Ƭ GraphQLServer: Object

Type declaration

NameType
portnumber
stop() => Promise<void>

HandlerParams

Ƭ HandlerParams<ServerContext>: Object

Type parameters

NameType
ServerContextextends Record<string, any> = Record<string, any>

Type declaration

NameTypeDescription
cache?DocumentCacheOptional cache for documents.
ceramicCeramicApi | stringCeramic client instance or HTTP URL.
definition?RuntimeCompositeDefinitionRuntime composite definition, created using the Composite development tools.
options?YogaServerOptions<ServerContext, Context>Yoga server options.
schema?GraphQLSchemaGraphQL Schema to use, ignores the definition parameter if provided.

Functions

createHandler

createHandler<ServerContext>(params): YogaServerInstance<ServerContext, Context>

Create a Yoga server handling GraphQL requests.

Type parameters

NameType
ServerContextextends Record<string, any> = Record<string, any>

Parameters

NameType
paramsHandlerParams<ServerContext>

Returns

YogaServerInstance<ServerContext, Context>


getViewerID

getViewerID(request): string | null | undefined

Returns the viewer ID sent by the client, if set.

Parameters

NameType
requestRequest

Returns

string | null | undefined


startGraphQLServer

startGraphQLServer<ServerContext>(params): Promise<GraphQLServer>

Start a local GraphQL server.

Type parameters

NameType
ServerContextextends Record<string, any> = Record<string, any>

Parameters

NameType
paramsGraphQLParams<ServerContext>

Returns

Promise<GraphQLServer>