Closed SPAHI4 closed 1 week ago
Types are not working
I have almost the same setup in 2 places, but
kind
import { useSuspenseQuery } from '@apollo/client'; import { graphql } from 'gql.tada'; const query = graphql(` query PostsQuery { allPosts { nodes { id } } } `); const Test = () => { const { data } = useSuspenseQuery(query); // data = unknown };
In the first case, I have already setup a huge project. What could possibly be wrong? graphql package version?
graphql
tsconfig:
{ "compilerOptions": { "baseUrl": "./src", "paths": { "@/*": ["./*"] }, "target": "ES2020", "lib": ["dom", "dom.iterable", "esnext"], "skipLibCheck": true, "strict": true, "module": "esnext", "moduleResolution": "bundler", "noEmit": true, "jsx": "react-jsx", "sourceMap": true, "plugins": [ { "name": "@0no-co/graphqlsp", "schema": "./schema2.graphql", "tadaOutputLocation": "./src/graphql-env.d.ts" } ] }, "include": ["src"], "references": [{ "path": "./tsconfig.node.json" }] }
No response
"@0no-co/graphqlsp": "^1.12.10", "typescript": "^5.5.3", "gql.tada": "^1.8.0", "@apollo/client": "^3.10.8",
I forced yarn resolutions to match graphql versions on both projects, no result
"resolutions": { "graphql": "15.9.0" }
gql.tada doctor no issues found
gql.tada doctor
I've found the issue, I deleted the line below:
"baseUrl": "./src",
Describe the bug
Types are not working
I have almost the same setup in 2 places, but
kind
In the first case, I have already setup a huge project. What could possibly be wrong?
graphql
package version?tsconfig:
Reproduction
No response
gql.tada version
I forced yarn resolutions to match
graphql
versions on both projects, no resultgql.tada doctor
no issues foundValidations