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

[email protected] causes type errors with [email protected] #4201

Closed
phryneas opened this issue Sep 24, 2024 · 5 comments
Closed

[email protected] causes type errors with [email protected] #4201

phryneas opened this issue Sep 24, 2024 · 5 comments

Comments

@phryneas
Copy link

This happened over in apollographql/vscode-graphql#175 (failing CI job):

node_modules/graphql-language-service/dist/parser/types.d.ts:116:37 - error TS2694: Namespace 'Kind' has no exported member 'LIST_NULLABILITY_OPERATOR'.

116     LIST_NULLABILITY_OPERATOR: Kind.LIST_NULLABILITY_OPERATOR;
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/graphql-language-service/dist/parser/types.d.ts:117:30 - error TS2694: Namespace 'Kind' has no exported member 'NON_NULL_ASSERTION'.

117     NON_NULL_ASSERTION: Kind.NON_NULL_ASSERTION;
                                 ~~~~~~~~~~~~~~~~~~

node_modules/graphql-language-service/dist/parser/types.d.ts:118:26 - error TS2694: Namespace 'Kind' has no exported member 'ERROR_BOUNDARY'.

118     ERROR_BOUNDARY: Kind.ERROR_BOUNDARY;
                             ~~~~~~~~~~~~~~

I'll open a PR to backport these enum members, as that seems to be the easiest way to prevent this

@JoviDeCroock
Copy link
Member

JoviDeCroock commented Sep 24, 2024

I think the main issue here is that graphql-language-service is using a newer alpha of graphql-js which has breaking changes included 😅 I don't see backporting as a viable option here as this will cause people to defensively code around options that would never be present.

It's even an || which means that the root job doesn't have graphql pinned https://github.com/graphql/graphiql/blob/main/packages/vscode-graphql/package.json#L182

@phryneas
Copy link
Author

phryneas commented Sep 24, 2024

graphql-language-service has very broad peerDependencies: "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0-alpha.2"

So it doesn't seem to depend on these at all - or that package.json is wrong.

See https://github.com/graphql/graphiql/pull/3682/files#diff-3c54a63be7298ecf874f61083633f9e943a5f606cdd5268e0c60520a4cdcd7b1

@JoviDeCroock
Copy link
Member

JoviDeCroock commented Sep 24, 2024

Exactly, I wouldn't consider that to be a reason to shoehorn those enum-members into a release that doesn't use them. The underlying issue here is that there's something not marked as external correctly as you can see in https://app.renovatebot.com/package-diff?name=graphql-language-service&from=5.2.2&to=5.3.0 - it's bundling in the kind types of their graphql devDep

@phryneas
Copy link
Author

Wait... they are bundling the types? Oh boy.

@phryneas
Copy link
Author

Opened graphql/graphiql#3790, closing here.

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

No branches or pull requests

2 participants