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

Try to break the dependency from `@apollo/gateway` on Apollo Server

Open glasser opened this issue 3 years ago • 2 comments

This dependency is a pain because it makes it hard to test prerelease of Apollo Server.

This will include:

  • [x] Seeing if we can get rid of the Logger type (#6056)
  • [ ] Considering keeping/moving the types required at build time to create plugins (and the "gateway" pseudo-plugin) out of @apollo/server (see #6041)
  • [ ] Finding an alternative to the errors exported from apollo-server-error (see also #6053)
  • [x] Better place to get createSHA from than deep inside apollo-server-core (presumably apollo-utils)
  • [x] Changing the dependency on apollo-reporting-protobuf to a new name like @apollo/usage-reporting-protobuf

Also these things that are dependencies of packages we are removing but that don't themselves depend on apollo-server-core

  • [x] Getting rid of apollo-server-env (see #6046)
  • [x] Getting rid of apollo-server-caching (see #6045)

glasser avatar Jan 26 '22 18:01 glasser

Another thing to keep in mind: Gateway's API (specifically the GraphQLDataSource.process function) contains the ability to read from GraphQLRequestContext, but this type is changing in AS4 (if nothing else, the type of its cache field is changing). So we may have to do something fancy in order to have a single @apollo/gateway package version that works with both AS3 and AS4; eg, you might need a separate ApolloGatewayForAS4 (or import { ApolloGateway } from '@apollo/gateway/as4' or something). (Or to do a major version bump on @apollo/gateway and have to maintain two branches in parallel, but we probably don't like that for various reasons, including the desire to keep Gateway and composition major versions in sync with each other.)

glasser avatar Apr 28 '22 21:04 glasser

Note that there is related work happening in https://github.com/apollographql/apollo-server/issues/6719.

hwillson avatar Jul 28 '22 20:07 hwillson

This is done!

glasser avatar Aug 11 '22 19:08 glasser