dotansimha / dotansimha/graphql-code-generator

Print missing dependency warnings for filetypes even if supported files match

Open
#10,017 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.3k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
23

Description

### Is your feature request related to a problem? Please describe.

I just spent 1.5 days debugging why building graphql types suddenly failed for seemingly no reason after doing some maintenance and upgrading a few packages. Eventually, I noticed that all errors seemed related to fragments that were defined in `.svelte` files. Just to test, I temporarily changed the `documents` glob to only match `.svelte` files, and it finally printed this error: `GraphQL template literals cannot be plucked from a Svelte template code without having the "svelte2tsx" & "svelte" package installed.` I installed svelte2tsx, which seemingly was previously a sub-dependency of some other package we were depending on, and the types finally built.

### Describe the solution you'd like

It seems like this error is suppressed if the glob matches at least one supported file, but at least in my case it'd have saved me so much time if it would've errored despite successfully parsing a few `.ts` files. Would be great if these dependency checks were done upfront for all file types matched by the document glob.

### Describe alternatives you've considered

_No response_

### Is your feature request related to a problem? Please describe.

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.