Skip to content

@apollo/subgraph: remove dependency on apollo-server-types #2037

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

Merged
merged 1 commit into from
Aug 4, 2022

Conversation

glasser
Copy link
Member

@glasser glasser commented Aug 4, 2022

apollo-server-types is an Apollo Server 3 package that is going away in
Apollo Server 4, so we don't want @apollo/subgraph to depend on it.
This was a build-time-only dependency (it just imported a type and that
type isn't used in the generated .d.ts files) but it would still be
helpful to minimize dependencies so that AS4 users don't also end up
with pieces of AS3 installed.

The new package @apollo/cache-control-types also has a function that
implements the "does it look like it's the right cacheControl object?"
itself, and it does not rely on AS3's declare module to globally
monkeypatch cacheControl onto GraphQLResolveInfo's type definition.

Part of apollographql/apollo-server#6057

apollo-server-types is an Apollo Server 3 package that is going away in
Apollo Server 4, so we don't want `@apollo/subgraph` to depend on it.
This was a build-time-only dependency (it just imported a type and that
type isn't used in the generated .d.ts files) but it would still be
helpful to minimize dependencies so that AS4 users don't also end up
with pieces of AS3 installed.

The new package `@apollo/cache-control-types` also has a function that
implements the "does it look like it's the right cacheControl object?"
itself, and it does not rely on AS3's `declare module` to globally
monkeypatch `cacheControl` onto `GraphQLResolveInfo`'s type definition.

Part of apollographql/apollo-server#6057
@glasser glasser requested a review from benweatherman August 4, 2022 01:07
@netlify
Copy link

netlify bot commented Aug 4, 2022

Deploy Preview for apollo-federation-docs canceled.

Name Link
🔨 Latest commit b7b4438
🔍 Latest deploy log https://app.netlify.com/sites/apollo-federation-docs/deploys/62eb1bb52157c70009a5976f

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 4, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Contributor

@benweatherman benweatherman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐐

@glasser glasser merged commit f01c0f1 into main Aug 4, 2022
@glasser glasser deleted the glasser/subgraph-cache-control-no-as3 branch August 4, 2022 19:19
glasser added a commit that referenced this pull request Aug 4, 2022
…types

(Note: as part of backporting, I put out another version
@apollo/[email protected] with
apollographql/apollo-utils#173 and will now
forward-port the dependency update.)

apollo-server-types is an Apollo Server 3 package that is going away in
Apollo Server 4, so we don't want `@apollo/subgraph` to depend on it.
This was a build-time-only dependency (it just imported a type and that
type isn't used in the generated .d.ts files) but it would still be
helpful to minimize dependencies so that AS4 users don't also end up
with pieces of AS3 installed.

The new package `@apollo/cache-control-types` also has a function that
implements the "does it look like it's the right cacheControl object?"
itself, and it does not rely on AS3's `declare module` to globally
monkeypatch `cacheControl` onto `GraphQLResolveInfo`'s type definition.

Part of apollographql/apollo-server#6057
glasser added a commit that referenced this pull request Aug 4, 2022
Turns out that if you have AS3 in your TS build (which version-0.x
does), you need to be a bit more careful how you declare some things.
This commit ensures that the extra care required for version-0.x doesn't
break main.
glasser added a commit that referenced this pull request Aug 4, 2022
Turns out that if you have AS3 in your TS build (which version-0.x
does), you need to be a bit more careful how you declare some things.
This commit ensures that the extra care required for version-0.x doesn't
break main.
glasser added a commit that referenced this pull request Aug 4, 2022
…types (#2039)

(Note: as part of backporting, I put out another version
@apollo/[email protected] with
apollographql/apollo-utils#173 and will now
forward-port the dependency update.)

apollo-server-types is an Apollo Server 3 package that is going away in
Apollo Server 4, so we don't want `@apollo/subgraph` to depend on it.
This was a build-time-only dependency (it just imported a type and that
type isn't used in the generated .d.ts files) but it would still be
helpful to minimize dependencies so that AS4 users don't also end up
with pieces of AS3 installed.

The new package `@apollo/cache-control-types` also has a function that
implements the "does it look like it's the right cacheControl object?"
itself, and it does not rely on AS3's `declare module` to globally
monkeypatch `cacheControl` onto `GraphQLResolveInfo`'s type definition.

Part of apollographql/apollo-server#6057
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

Successfully merging this pull request may close these issues.

2 participants