Replies: 1 comment
-
I think I found the issue here, which is that somewhere along the way the pnpm linking behavior I had been relying on for transitive dependencies seemed to either have changed, or whatever shaky truce I had was broken. Transitive types were not being resolved by editor Typescript because they were not hoisted or otherwise accessible from the first-level dependency modules. I "fixed" this by enabling |
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
-
I've been successfully using
gql.tada
in a rather complicated monorepo, more or less crossing my fingers the whole time.Recently I updated several dependencies, including gql.tada and Typescript, as well as upgraded to Node 22 (from 18). After the dust settled, all my
graphql(...)
calls returnany
, and I can't figure out why.My monorepo structure consists of one server (with the GraphQL endpoint) and many different frontend apps which consume the API. So, my goal is to have all of these app sub-projects able to validate and type their GraphQL documents against the same API schema.
Here is the repo.
My API auto-generates a schema file, so that's taken care of. I've tried many different approaches to integrating
gql.tada
, but for the sake of (I hope) reducing accidental complexity, I've just refactored so that each app/package which creates gql documents hasgql.tada
as a direct dependency and configuration intsconfig.json
which points to the shared schema file (packages/graphql/schema.graphql
) and outputs the env typings to the localsrc
directory. All of this appears to work and the typings are written to file. See theweb
directory for a live example.Importing
graphql
, the function itself has types (it's notany
or unresolved). But no matter what doc I pass in, it returnsany
.Additionally, I use ESM modules/resolution exclusively. I've seen in the past how, if the typings of a library aren't ESM compatible, it's silently failed to
any
somewhere downstream before. But as I said,gql.tada
was functional for me up until this recent dependency upgrade fest. And downgradinggql.tada
back to1.8.2
(where I was before) doesn't seem to help.Beta Was this translation helpful? Give feedback.
All reactions