question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Types mismatch: ApolloServer/ApolloServerBase

See original GitHub issue

Following the example of an integration test:

https://github.com/apollographql/fullstack-tutorial/blob/6988f6948668ccc2dea3f7a216dd44bdf25a0b9f/final/server/src/__tests__/__utils.js#L25-L30

https://github.com/apollographql/fullstack-tutorial/blob/6988f6948668ccc2dea3f7a216dd44bdf25a0b9f/final/server/src/__tests__/integration.js#L87

Environment

  • apollo-server-express@2.8.1
  • apollo-server-testing@2.9.2
  • typescript@3.5.3

The issue

The output type of new ApolloServer is ApolloServer, while the input type to createTestClient is ApolloServerBase. This makes these functions not compatible.

I’m using TypeScript, therefore I can experience this error.

Expected behavior

a) createTestClient(server: ApolloServer) b) Change the example of creating a server instance to return expected ApolloServerBase.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:7

github_iconTop GitHub Comments

6reactions
HurricaneJamescommented, Dec 6, 2019

I just had the same issue. In my case upgrading both apollo-server and apollo-server-testing to 2.9.13 fixed the problem. I think the solution is just to make sure the apollo-server, or apollo-server-express, version is in sync with apollo-server-testing.

5reactions
kettanaitocommented, Dec 9, 2019

I confirm that updating to the following versions of packages fixed the issue for me:

{
  "apollo-server-express": "2.9.13",
  "apollo-server-testing": "2.9.13
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

graphql - Type mismatch on variable and argument (Int / Int)
How is Int and Int Type mismatched? The first variable/argument error reoprts the same error (Int / Int) when I correctly pass 3...
Read more >
Type Mismatch error but can't fathom it out... : r/androiddev
When I try to run the app - which has worked fine up until this section - I get the following error in...
Read more >
Mismatch using Microsoft.SqlServer.Types - MSDN
In my VB class I import Microsoft. SqlServer. Types and that causes the problem. It wants to use Version 10 of the dll...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found