Closed zaniluca closed 2 years ago
I found the error, i wasn't properly adding the generated types from nexus in my tsconfig.json
.
Seems like that having the generated types in node_modules/@types
doesn't work.
Set the value you specified in your schema in the tsconfig
export const schema = makeSchema({
...
// Where the generated files are placed
outputs: {
typegen: join(__dirname, "./generated/nexus-typegen/index.d.ts"),
schema: join(__dirname, "./generated/schema.graphql"), // <--- This path
},
...
Like so
{
"typeRoots": [
"./src/graphql/generated/nexus-typegen"
]
}
Issue and Screenshot
When adding the validation
VSCode
keeps giving this typescript errorThe code is this and it works fine when running, it just gives the error in the editor without going away even after restarting the ts server and the editor.
Code
Versions