Tag: codegen
-
Codegen and Graphql-Request Error: Server Error TypeError: Cannot read properties of null (reading ‘useState’)
0 This is the Error image im getting when I start my frontend Server Error TypeError: Cannot read properties of null (reading ‘useState’) This error happened while generating the page. Any console logs will be displayed in the terminal window. I am building a Full stack App using NextJs,GraphQL and codegen. When i run the…
-
Issue with Nullable Types in Hasura GraphQL Schema Generation
0 I am facing an issue with the return types of Hasura queries when generating schemas using the codegen library (via yarn graphql-codegen –config codegen.ts command). Previously, the generated schema used to look like this: schema in graphql.schema.json — { "kind": "OBJECT", "name": "table_name", "description": "columns and relationships of "table_name"", "fields": [ ….. { "name":…
-
Tried to use the environment variable in graphql codegen file
0 I tried to use the environment variable in the codegen.yml. I decided to generate the codegen.yml file by using the handlebars. yarn add handlebars codegen-template.yml overwrite: true generates: ./src/generated/graphql.tsx: schema: "{{REACT_APP_GRAPHQL_ENDPOINT}}" documents: src/**/*.graphql plugins: – typescript – typescript-operations – typescript-react-apollo package.json "scripts": { "generate-yaml": "npx handlebars -c .env -i codegen-template.yml -o codegen.yml" } and…
-
Typescript and Graphql Fragments
0 I use codegen to generate TS types and I use Apollo client to send queries to server. when I generate code for the following example, Typescript dosen’t know that people has firstName and lastName fields, It only knows that avatar field exists. If I remove fragment and move fields directly to query all fields…
-
Graphql Codegen’s client-preset-swc-plugin not working at all
0 I couldn’t use Graphql Codegen’s client-preset-swc-plugin with Vite at all to reduce the bundle size. It panics when trying to build for production, I’m getting this error: [vite-plugin-pwa:build] failed to handle: failed to invoke plugin: failed to invoke plugin on ‘Some("/home/user/project/web/src/index.tsx")’ Caused by: 0: failed to invoke `/home/user/project/web/node_modules/@graphql-codegen/client-preset-swc-plugin/swc_plugin.wasm` as js transform plugin at /home/user/project/web/node_modules/@graphql-codegen/client-preset-swc-plugin/swc_plugin.wasm…