Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types: Add @types/aws-lambda as a dependency of apollo-server-lambda. #3242

Merged

Conversation

abernix
Copy link
Member

@abernix abernix commented Sep 1, 2019

The typings provided by aws-types are used on public methods within the apollo-server-express package and, therefore, must be included as direct (not development) dependencies to ensure they are available to packages which utilize it since we don't publish types separately (e.g. via DefinitelyTyped).

For example, these usages:

export function graphqlLambda(
options: GraphQLOptions | LambdaGraphQLOptionsFunction,
): lambda.APIGatewayProxyHandler {

return (
event: APIGatewayProxyEvent,
context: LambdaContext,
callback: APIGatewayProxyCallback,
) => {

And seen in the emitted type declarations here:

https://unpkg.com/apollo-server-lambda@2.9.0/dist/ApolloServer.d.ts
https://unpkg.com/apollo-server-lambda@2.9.0/dist/lambdaApollo.d.ts

(Note the import statements, which must be resolvable by TypeScript!)

Fixes: #2351

…da`.

The typings provided by `aws-types` are used on public methods within the
`apollo-server-express` package and, therefore, must be included as direct
(not development) dependencies to ensure they are available to packages
which utilize it since we don't publish types separately (e.g. via
DefinitelyTyped).

For example, these usages:

https://github.com/apollographql/apollo-server/blob/aa3e23de9fbcde41a1bd3cca9c2eacf734bae582/packages/apollo-server-lambda/src/lambdaApollo.ts#L16-L18

https://github.com/apollographql/apollo-server/blob/aa3e23de9fbcde41a1bd3cca9c2eacf734bae582/packages/apollo-server-lambda/src/ApolloServer.ts#L100-L104

And seen in the emitted type declarations here:

https://unpkg.com/apollo-server-lambda@2.9.0/dist/ApolloServer.d.ts
https://unpkg.com/apollo-server-lambda@2.9.0/dist/lambdaApollo.d.ts

(Note the `import` statements, which must be resolvable by TypeScript!)

Fixes: #2351
@abernix abernix merged commit 35816b8 into master Sep 1, 2019
@abernix abernix deleted the abernix/add-aws-lambda-typings-to-apollo-server-lambda branch September 1, 2019 21:06
@abernix abernix added this to the Release 2.9.3 milestone Sep 1, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws-lambda used in ApolloServer.d.ts not referenced in package.json
1 participant