Skip to content

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

Merged
abernix merged 2 commits into
masterfrom
abernix/add-aws-lambda-typings-to-apollo-server-lambda
Sep 1, 2019
Merged

types: Add @types/aws-lambda as a dependency of apollo-server-lambda.#3242
abernix merged 2 commits into
masterfrom
abernix/add-aws-lambda-typings-to-apollo-server-lambda

Conversation

@abernix

@abernix abernix commented Sep 1, 2019

Copy link
Copy Markdown
Member

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