Replies: 1 comment
-
|
Commenting to note I have the same issue and this is the first google search result, ever figure out what is causing this? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there,
I maintain a large-ish SvelteKit project that uses graphql-code-generator to render types using the
near-operation-filepreset. We define fragments for each component, nest them for nested components, and eventually import those fragments to build queries on the page level. This has worked great for us for months.Today though, I went through some spring cleaning and upgraded a whole bunch of dependencies (incl. typescript, svelte, etc.), and I got everything to work again other than for some reason GQL type generation. It fails with
Error 0: Unknown fragment "ProjectAvatar"in some random file. If I remove theProjectAvatarfragment and manually copy its fields to the other fragment it errors on, it just complains about some other fragment in a different location. It's as if it just suddenly can't see external fragments anymore at all, even though we explicitly import them and interpolate them into the strings.I tripled checked every conceivable reason for hours, looked into potential breaking changes in any related packages, but came up with nothing — I really don't get why it wouldn't work anymore. I'm also 99% sure that there are no errors in my queries and fragments, because when I
npm iour previous set of dependencies, switch to the branch where I'm having this problem, and then run the codegen, it builds types fine. As soon as Inpm iwith the new set of packages, the problem is back. I even tried manually downgrading all the graphql-related files to the same version as before, and the problem somehow persists. There are also NO compiler errors anywhere in the project (apart from missing gql types ofc). I'm really at a loss here.Since our setup really isn't all that unique, maybe someone could point me in the right direction?
Here's our codegen config:
Here's the fragment def that it complains about (though as I said, if I remove
ProjectAvatarfrom here, it just complains about a different fragment):... and here's the fragment definition in
ProjectAvatar.svelte:Beta Was this translation helpful? Give feedback.
All reactions