V0: Change dependency on Apollo Server 3 to new type package #2050
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #2044.
This removes the last dependency on Apollo Server from Apollo Gateway.
Part of apollographql/apollo-server#6057 and
apollographql/apollo-server#6719
The new package
@apollo/server-gateway-interface
(in the apollo-utilsrepo for now, though it should move to the apollo-server repo once AS4
is fully released) defines types that are pretty close to compatible
with the AS3 types previously used here, but don't require a dependency
on the entirety of AS3. This new package will be used by AS4 and AS4
will convert its data into the format described by these types.
This change is entirely a build-time change (other than a slight change
to how a enum is referenced). So the worst case scenario if this differs
unintentionally from the original AS3 definitions is that users can
apply a bit of
as any
to fix it.Note that we've removed some
<TContext>
from types that it turned outwere only ever instantiated with
Record<string, any>
anyway. They areleft in in RemoteGraphQLDataSource because users making their own data
sources can explicitly specify their context type.
The types in
@apollo/server-gateway-interface
are pretty close to theAS3 types (with different names) but there are some slight differences.
The cache scope enum is replaced with
any
, as enums are notstructurally typed and it is otherwise difficult to type them.
GatewayInterface
now expectsonSchemaLoadOrUpdate
to exist anddoesn't mention the old
onSchemaChange
.For now, we leave
apollo-reporting-protobuf
alone, so we don't have a directdependency on a prerelease.