apollo-log icon indicating copy to clipboard operation
apollo-log copied to clipboard

Upgrade to apollo-server 3

Open arthurgeek opened this issue 2 years ago • 0 comments

This PR contains:

  • [x] bugfix
  • [x] feature
  • [ ] refactor
  • [ ] tests
  • [ ] documentation
  • [ ] metadata

Breaking Changes?

  • [ ] yes
  • [ ] no
  • [x] not sure

If yes, please describe the breakage.

I'm unsure if this breaks under apollo-server version 2.

Please Describe Your Changes

Hi! I'm new to Apollo and wanted to use this plugin, but it fails to compile with Apollo 3.

The details on why are here: https://www.apollographql.com/docs/apollo-server/migration/#plugin-api, specially this part:

In practice, this means that all of your plugin events should use async functions or methods. If you are using TypeScript, you need to do this for your code to compile.

I don't know if you want to have this change applied or not. I haven't tested if it still works for Apollo Server 2.

Besides the main upgrade, this also upgrades apollo-boost used in the tests to apollo-client since apollo-boost is now deprecated. but, unfortunately, this made lint fail with error Missing file extension "cjs" for "@apollo/client/core" import/extensions. This import comes from here: https://www.apollographql.com/docs/react/migrating/apollo-client-3-migration/#using-apollo-client-without-react and if we use from @apollo/client, it wants to add React as a dependency. The code works and compile fine, is just that lint throws this error.

arthurgeek avatar Nov 24 '21 03:11 arthurgeek