Skip to content
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 5 commits into from
Nov 27, 2019

Conversation

abernix
Copy link
Member

@abernix abernix commented Nov 22, 2019

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:

export type GatewayConfig =
| RemoteGatewayConfig
| LocalGatewayConfig
| ManagedGatewayConfig;

RemoteGatewayConfig:

interface RemoteGatewayConfig extends GatewayConfigBase {

Fixes: #3471

@abernix abernix closed this Nov 22, 2019
@abernix abernix reopened this Nov 22, 2019
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 abernix force-pushed the abernix/add-node-fetch-non-dev-dep branch from ee36267 to 8a583bd Compare November 22, 2019 16:18
@abernix abernix marked this pull request as ready for review November 22, 2019 16:27
@abernix abernix merged commit c63786b into master Nov 27, 2019
@abernix abernix deleted the abernix/add-node-fetch-non-dev-dep branch November 27, 2019 14:47
@abernix abernix added this to the Release 2.9.13 milestone Dec 17, 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
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
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@apollo/gateway doesn't include node-fetch in its dependencies
2 participants