Skip to content

Commit

Permalink
refactor(apollo-server-mutation): better types for adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
H4ad committed Feb 29, 2024
1 parent 1effcae commit 79f3383
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/adapters/apollo-server/apollo-server-mutation.adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ export type ApolloServerMutationAdapterOptions = {
* @breadcrumb Adapters / Apollo Server / ApolloServerMutationAdapter
* @public
*/
export class ApolloServerMutationAdapter<
TEvent,
TContext,
TResponse,
TBaseAdapter extends AdapterContract<TEvent, TContext, TResponse>,
> implements AdapterContract<TEvent, TContext, TResponse>
export class ApolloServerMutationAdapter<TEvent, TContext, TResponse>
implements AdapterContract<TEvent, TContext, TResponse>
{
//#region Constructor

/**
* The default constructor
*/
constructor(
protected readonly baseAdapter: TBaseAdapter,
protected readonly baseAdapter: AdapterContract<
TEvent,
TContext,
TResponse
>,
protected readonly options: ApolloServerMutationAdapterOptions,
) {}

Expand Down
9 changes: 5 additions & 4 deletions test/adapters/apollo-server/apollo-mutation.adapter.spec.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { ApolloServer } from '@apollo/server';
import { describe, expect, it, vitest } from 'vitest';
import type { SQSEvent } from 'aws-lambda';
import {
AdapterContract,
type AdapterContract,
EmptyResponse,
GetResponseAdapterProps,
type GetResponseAdapterProps,
ServerlessRequest,
ServerlessResponse,
createDefaultLogger,
waitForStreamComplete,
} from '../../../src';
import {
ApolloServerMutationAdapter,
ApolloServerMutationAdapterOptions,
type ApolloServerMutationAdapterOptions,
} from '../../../src/adapters/apollo-server';
import {
DynamoDBAdapter,
Expand Down Expand Up @@ -279,7 +280,7 @@ it('onErrorWhileForwarding: should forward error dealing to base adapter', () =>
});

const props = {
event: {},
event: {} as SQSEvent,
log: createDefaultLogger(),
error: new Error(),
delegatedResolver: { fail: vitest.fn(), succeed: vitest.fn() },
Expand Down

0 comments on commit 79f3383

Please sign in to comment.