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

Incompatible types with apollo-server-express 2.12.0 #6

Open
darky opened this issue Apr 16, 2020 · 2 comments
Open

Incompatible types with apollo-server-express 2.12.0 #6

darky opened this issue Apr 16, 2020 · 2 comments

Comments

@darky
Copy link

darky commented Apr 16, 2020

Type 'import("/Users/vladislavbotvin/Projects/bla-bla/node_modules/apollo-server-express/dist/ApolloServer").ApolloServer' is not assignable to type 'import("/Users/vladislavbotvin/Projects/bla-bla/node_modules/apollo-server-integration-testing/node_modules/apollo-server-express/dist/ApolloServer").ApolloServer'.
  The types returned by 'createGraphQLServerOptions(...)' are incompatible between these types.
    Type 'Promise<import("/Users/vladislavbotvin/Projects/bla-bla/node_modules/apollo-server-express/node_modules/apollo-server-core/dist/graphqlOptions").GraphQLServerOptions<Record<string, any>, any>>' is not assignable to type 'Promise<import("/Users/vladislavbotvin/Projects/bla-bla/node_modules/apollo-server-core/dist/graphqlOptions").GraphQLServerOptions<Record<string, any>, any>>'.
      Type 'import("/Users/vladislavbotvin/Projects/bla-bla/node_modules/apollo-server-express/node_modules/apollo-server-core/dist/graphqlOptions").GraphQLServerOptions<Record<string, any>, any>' is not assignable to type 'import("/Users/vladislavbotvin/Projects/bla-bla/node_modules/apollo-server-core/dist/graphqlOptions").GraphQLServerOptions<Record<string, any>, any>'.
        Types of property 'executor' are incompatible.
          Type 'import("/Users/vladislavbotvin/Projects/bla-bla/node_modules/apollo-server-express/node_modules/apollo-server-types/dist/index").GraphQLExecutor<Record<string, any>> | undefined' is not assignable to type 'import("/Users/vladislavbotvin/Projects/bla-bla/node_modules/apollo-server-types/dist/index").GraphQLExecutor<Record<string, any>> | undefined'.
            Type 'import("/Users/vladislavbotvin/Projects/bla-bla/node_modules/apollo-server-express/node_modules/apollo-server-types/dist/index").GraphQLExecutor<Record<string, any>>' is not assignable to type 'import("/Users/vladislavbotvin/Projects/bla-bla/node_modules/apollo-server-types/dist/index").GraphQLExecutor<Record<string, any>>'.
              Types of parameters 'requestContext' and 'requestContext' are incompatible.
                Type 'WithRequired<GraphQLRequestContext<Record<string, any>>, "queryHash" | "document" | "operation" | "operationName">' is not assignable to type 'GraphQLRequestContextExecutionDidStart<Record<string, any>>'.
                  Property 'logger' is missing in type 'GraphQLRequestContext<Record<string, any>> & Required<Pick<GraphQLRequestContext<Record<string, any>>, "queryHash" | "document" | "operation" | "operationName">>' but required in type 'GraphQLRequestContext<Record<string, any>>'.ts(2322)
index.d.ts(51, 5): 'logger' is declared here.
index.d.ts(9, 5): The expected type comes from property 'apolloServer' which is declared here on type 'TestClientConfig'

2.11.0 version fine

@vitorbal
Copy link
Contributor

@darky thanks for the report. Feel free to open a pull request to fix this. We haven't updated to apollo-server-express 2.12.0 internally yet so I won't be able to prioritize this right now.

If a PR is not possible, then a repository where it can be reproduced would be great 👍 thanks!

@gustawdaniel
Copy link

Anyway, it should be better to give the user which implementation of apollo he wants to use:

In my case I need apollo-server, no apollo-server-express

https://www.apollographql.com/docs/apollo-server/integrations/middleware#apollo-server

and have errors in typescript, that my pure server (without express) is incompatible:

Screenshot 2022-04-15 at 19 32 32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants