Regenerate SDLfailed after updating shcema

yarn rw g sdl building -f
:heavy_check_mark: Generating SDL files…
:heavy_check_mark: Successfully wrote file ./api/src/graphql/buildings.sdl.ts
:heavy_check_mark: Successfully wrote file ./api/src/services/buildings/buildings.scenarios.ts
:heavy_check_mark: Successfully wrote file ./api/src/services/buildings/buildings.test.ts
:heavy_check_mark: Successfully wrote file ./api/src/services/buildings/buildings.ts
:heavy_check_mark: Generating types …

Error: Could not generate GraphQL type definitions (web)
Error: GraphQL Document Validation failed with 6 errors;
Error 0: Cannot query field “desc” on type “Building”.

I change desc to to description and other field too

at /mnt/storage2/Projects/skripsi/historyb-redwoodjs/web/src/components/Building/BuildingCell/BuildingCell.tsx:5:5

Error 1: Cannot query field “link3dAsset” on type “Building”.
at /mnt/storage2/Projects/skripsi/historyb-redwoodjs/web/src/components/Building/BuildingCell/BuildingCell.tsx:6:5

Error 2: Cannot query field “link360vAsset” on type “Building”.
at /mnt/storage2/Projects/skripsi/historyb-redwoodjs/web/src/components/Building/BuildingCell/BuildingCell.tsx:7:5

Error 3: Cannot query field “desc” on type “Building”.
at /mnt/storage2/Projects/skripsi/historyb-redwoodjs/web/src/components/Building/BuildingsCell/BuildingsCell.tsx:5:5

Error 4: Cannot query field “desc” on type “Building”.
at /mnt/storage2/Projects/skripsi/historyb-redwoodjs/web/src/components/Building/EditBuildingCell/EditBuildingCell.tsx:5:5

Error 5: Cannot query field “desc” on type “Building”.
at /mnt/storage2/Projects/skripsi/historyb-redwoodjs/web/src/components/Building/EditBuildingCell/EditBuildingCell.tsx:5:5
at codegen (/mnt/storage2/Projects/skripsi/historyb-redwoodjs/node_modules/@graphql-codegen/core/cjs/codegen.js:83:19)
at async runCodegenGraphQL (/mnt/storage2/Projects/skripsi/historyb-redwoodjs/node_modules/@redwoodjs/internal/dist/generate/graphqlCodeGen.js:164:18)
at async generateTypeDefGraphQLWeb (/mnt/storage2/Projects/skripsi/historyb-redwoodjs/node_modules/@redwoodjs/internal/dist/generate/graphqlCodeGen.js:131:21)
at async generateTypeDefs (/mnt/storage2/Projects/skripsi/historyb-redwoodjs/node_modules/@redwoodjs/internal/dist/generate/typeDefinitions.js:53:7)
at async generate (/mnt/storage2/Projects/skripsi/historyb-redwoodjs/node_modules/@redwoodjs/internal/dist/generate/generate.js:24:7)
at async Task.task [as taskFn] (/mnt/storage2/Projects/skripsi/historyb-redwoodjs/node_modules/@redwoodjs/cli/dist/commands/generate/sdl/sdl.js:287:13)
at async Task.run (/mnt/storage2/Projects/skripsi/historyb-redwoodjs/node_modules/listr2/dist/index.cjs:2040:11)

Hi @Moanrisy ,

I get this when the fields queried in my cells don’t match the types in sdl. Usually I fix the cells according to the sdl and regenerate the types, that would fix it.

Can you share the sdl for Building and the QUERY for the following cells?

  • BuildingCell
  • BuildingsCell
  • EditBuildingCell

yarn rw g types didn’t work too.

I think I have given up on using redwood CLI tool to fix this.
So I just manually update the QUERY and MUTATION on the Cell that you mentioned.

If I’m not using frameworks, it’s usually like that after updating the schema, I need to manually update the query and mutation.

1 Like

Ah! Yes I don’t think the CLI would have helped :thinking: plus the g stands for generate, I’d have expected a different command to fix it.

Has the doc led you to believe the CLI would be helpful in fixing this? We might need to update it then.

I thought If that troubleshoot have a fix using the cli rw g. Maybe it work on my case.