Skip to content

Typing issues with "ApolloServerExpressConfig" in version 2.4.8 #2469

@stefanholzapfel

Description

@stefanholzapfel

Since upgrading from apollo-server-express 2.4.2 to 2.4.8 I have two typing issues with the ApolloServer config used in the constructor:

1.) I can't use the "formatError" from the apollo-erros package (version1.9.0) anymore. I get this error:

Type '(error: any, returnNull?: boolean) => ErrorInfo' is not assignable to type '(error: GraphQLError) => GraphQLFormattedError'.   Type 'ErrorInfo' is not assignable to type 'GraphQLFormattedError'.     Property 'locations' is optional in type 'ErrorInfo' but required in type 'GraphQLFormattedError'.

2.) I can't access the "connection" parameter anymore from the context creation function (it returns an "ExpressContext"). It's not a recognized parameter anymore.

But in the docs it's still the propesed way to create context for subscriptions: https://www.apollographql.com/docs/apollo-server/features/subscriptions.html#Context-with-Subscriptions

I have to stick with version 2.4.2 until this problem is resolved.

Thanks for any help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🪲 bug🧬 typingsRelates to TypeScript changes or improvements.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions