-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add production dependency on @types/node-fetch
.
#3546
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As the `HeadersInit` is exported and used in the exported [`GatewayConfig`] type via [`RemoteGatewayConfig`] - which is emitted to `@apollo/gateway`'s `dist/index.d.ts` declaration, the `node-fetch` types need to be available by those who install the package. [`GatewayConfig`]: https://github.com/apollographql/apollo-server/blob/73cdf0d533908894282debdb6dc5444186af27a6/packages/apollo-gateway/src/index.ts#L74-L77 [`RemoteGatewayConfig`]: https://github.com/apollographql/apollo-server/blob/73cdf0d533908894282debdb6dc5444186af27a6/packages/apollo-gateway/src/index.ts#L62 Fixes: #3471
abernix
force-pushed
the
abernix/add-node-fetch-non-dev-dep
branch
from
November 22, 2019 16:18
ee36267
to
8a583bd
Compare
trevor-scheer
approved these changes
Nov 22, 2019
abernix
added a commit
to apollographql/federation
that referenced
this pull request
Sep 4, 2020
…lo-server#3546) * Add production dependency on `@types/node-fetch`. As the `HeadersInit` is exported and used in the exported [`GatewayConfig`] type via [`RemoteGatewayConfig`] - which is emitted to `@apollo/gateway`'s `dist/index.d.ts` declaration, the `node-fetch` types need to be available by those who install the package. [`GatewayConfig`]: https://github.com/apollographql/apollo-server/blob/73cdf0d533908894282debdb6dc5444186af27a6/packages/apollo-gateway/src/index.ts#L74-L77 [`RemoteGatewayConfig`]: https://github.com/apollographql/apollo-server/blob/73cdf0d533908894282debdb6dc5444186af27a6/packages/apollo-gateway/src/index.ts#L62 Fixes: apollographql/apollo-server#3471 * Add CHANGELOG.md for apollographql/apollo-server#3546. Apollo-Orig-Commit-AS: apollographql/apollo-server@c63786b
benweatherman
added a commit
to apollographql/federation
that referenced
this pull request
Jul 9, 2022
We do use `node-fetch` during runtime for some of the public methods in `RemoteGraphQLDataSource`. Using `node-fetch@2` because v3 is ESM-only. There's already a renovate rule to keep things from going to v3. We should probably break the interfaces that are using `node-fetch`'s classes, since they aren't used by the default implementation after switching to `make-fetch-happen`. ### Other detritus - **Move `@types/node-fetch` to `devDependencies`** This was originally included in apollographql/apollo-server#3546 as a fix for apollographql/apollo-server#3471. I think this is more appropriate for types. - **Change some imports to use `type`** so there's no runtime dependency for things that are just using types. - **Add `@types/make-fetch-happen`** - **Remove `pretty-format`** since that's not a runtime thing Fixes #1961
2 tasks
benweatherman
added a commit
to apollographql/federation
that referenced
this pull request
Jul 18, 2022
We use `node-fetch` during runtime for some of the public methods in `RemoteGraphQLDataSource`. Using `node-fetch@2` because v3 is ESM-only. There's already a renovate rule to keep things from going to v3. We should probably break the interfaces that are using `node-fetch`'s classes, since they aren't used by the default implementation after switching to `make-fetch-happen`. ### Other detritus - **Remove `@types/node-fetch`** This was originally included in apollographql/apollo-server#3546 as a fix for apollographql/apollo-server#3471. - **Change some imports to use `type`** so there's no runtime dependency for things that are just using types. - **Remove `pretty-format`** since that's not a runtime thing
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
As the
HeadersInit
is exported and used in the exportedGatewayConfig
type viaRemoteGatewayConfig
- which is emitted to@apollo/gateway
'sdist/index.d.ts
declaration, thenode-fetch
types need to be available by those who install the package.GatewayConfig
:apollo-server/packages/apollo-gateway/src/index.ts
Lines 74 to 77 in 73cdf0d
RemoteGatewayConfig
:apollo-server/packages/apollo-gateway/src/index.ts
Line 62 in 73cdf0d
Fixes: #3471