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

Import d.ts from @apollo/federation and @apollo/gateway instead of ts #1605

Merged
merged 2 commits into from
Jul 1, 2021
Merged

Conversation

shian15810
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[x] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

Currently, the ts files from @apollo/federation and @apollo/gateway are being imported directly, hence any stricter configuration to tsconfig.json on the consumer level is being enforced on these ts files from @apollo/federation and @apollo/gateway.

For example, I have importsNotUsedAsValues as error in my local tsconfig.json, and even with skipLibCheck as true, tsc still throw this error:

node_modules/@apollo/gateway/src/datasources/types.ts:1:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

1 import { GraphQLResponse, GraphQLRequestContext } from 'apollo-server-types';
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[8:31:55 PM] Found 1 error. Watching for file changes.

What is the new behavior?

With the changes, tsc will resolve d.ts files in dist instead of ts files in src. Hence any stricter configuration made in tsconfig.json is not being applied on these ts files anymore.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@kamilmysliwiec
Copy link
Member

LGTM

@kamilmysliwiec kamilmysliwiec merged commit 392a9ae into nestjs:master Jul 1, 2021
@shian15810 shian15810 deleted the apollo branch July 1, 2021 10:47
@shian15810
Copy link
Contributor Author

Thanks. Is it possible to have a new release?

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