Skip to main content

ApolloServerMutationAdapter

@h4ad/serverless-adapter > ApolloServerMutationAdapter

(class) ApolloServerMutationAdapter

The adapter that wraps another adapter to force a transformation of the event data as a mutation to Apollo Server be able to handle.

Signature:

export declare class ApolloServerMutationAdapter<TEvent, TContext, TResponse> implements AdapterContract<TEvent, TContext, TResponse> 

Implements: AdapterContract <TEvent, TContext, TResponse>

(constructor)

The default constructor

Signature:

constructor(baseAdapter: AdapterContract<TEvent, TContext, TResponse>, options: ApolloServerMutationAdapterOptions);

Parameters

ParameterTypeDescription
baseAdapterAdapterContract <TEvent, TContext, TResponse>
optionsApolloServerMutationAdapterOptions

(property) baseAdapter

Signature:

protected readonly baseAdapter: AdapterContract<TEvent, TContext, TResponse>;

(method) canHandle

Signature:

canHandle(event: unknown, context: TContext, log: ILogger): boolean;

Parameters

ParameterTypeDescription
eventunknown
contextTContext
logILogger

Returns:

boolean

(method) getAdapterName

Signature:

getAdapterName(): string;

Returns:

string

(method) getRequest

Signature:

getRequest(event: TEvent, context: TContext, log: ILogger): AdapterRequest;

Parameters

ParameterTypeDescription
eventTEvent
contextTContext
logILogger

Returns:

AdapterRequest

(method) getResponse

Signature:

getResponse(props: GetResponseAdapterProps<TEvent>): TResponse;

Parameters

ParameterTypeDescription
propsGetResponseAdapterProps <TEvent>

Returns:

TResponse

(method) onErrorWhileForwarding

Signature:

onErrorWhileForwarding(props: OnErrorProps<TEvent, TResponse>): void;

Parameters

ParameterTypeDescription
propsOnErrorProps <TEvent, TResponse>

Returns:

void

(property) options

Signature:

protected readonly options: ApolloServerMutationAdapterOptions;