193 questions
1 vote
1 answer
231 views
Generated file uses skipToken import incorrectly in Next.js App Router
I’m using Apollo Client v4 (4.0.5) with Next.js App Router and GraphQL Code Generator (typescript-react-apollo) to generate TypeScript types and hooks for my GraphQL API. Everything was working fine ...
0 votes
0 answers
20 views
yarn graphql-codegen error " require() of ES Module Y from Y not supported"
I get error: require() of ES Module D:\PROJEKTI\cvmds-client\node_modules\upper-case\dist\index.js from D:\PROJEKTI\cvmds-cl… error Command failed with exit code 1. This is package.json: { "...
0 votes
1 answer
87 views
Can't add generated TypeScript module file to global space [closed]
I have generated (from GraphQL Codegen and my API) a TypeScript types modules file and want to add all of its types to my project, application-wide (globally). The types are in src/generated/...
0 votes
1 answer
80 views
is it possible to generate typing for the cache object of apollo client mutation?
I’m using graphql-codegen with apollo-client. Everything works great except one thing: I tried to update cache after mutation, the update function of client.mutate doesn’t have typings for the cache ...
1 vote
1 answer
103 views
Multiple queries in single request using DgsGraphQlClient
Is there a way to send multiple queries(netflix dgs generated query and projection DTO's) using the DgsGraphQlClient wrapper class? For example, I have below schema: type Query { books: [Book] ...
0 votes
0 answers
81 views
I'm trying out the code generator for GraphQL in my React TypeScript application and some types are not resolved correctly, why?
I am using the graphql-codegen/cli library to generate queries and responses for my GraphQL requests on my TypeScript/React application. So far I'm creating my objects resulting in four files: ...
0 votes
0 answers
43 views
graphql codegen is suggesting everywhere but server directory in nuxt
I tried this for graphql type suggestion in typescript files. I have added graphql ^16.11.0 @0no-co/graphqlsp ^1.12.16 @graphql-codegen/cli ^5.0.6 @graphql-codegen/schema-ast ^4.1.0 @parcel/watcher ^2....
0 votes
0 answers
115 views
Graphql-codegen broken with Node v23
When trying to generate graphql queries automatically for my vite app, I'm encountering this error: 18:02 $ npm run codegen > [email protected] codegen > graphql-codegen /home/...
0 votes
0 answers
209 views
graphql-codegen error Not all operations have an unique name
mutation CreateFmfirmwarecompliance($user1: UserType!, $user2: UserType!,) { createFmfirmwarecompliance(input: $user1) { description name } createFmfirmwarecompliance(input: $...
-1 votes
1 answer
109 views
graphql codegen typescript suddenly brokes and don't want generate types
GraphQL code generator ceased functioning correctly anymore. It no longer generates the expected code and has also deleted all previously generated files. codegen.ts and package.json was not changed. ...
2 votes
1 answer
1k views
`Error: Invalid AST Node: {}.` when calling API using graphql, graphql-request, and react-query
Getting a repeated Error: Invalid AST Node: {}. error when trying to hit my API using a combination of graphql, graphql-request, and react-query. Here's the root application where I'm making the call: ...
3 votes
0 answers
185 views
Webpack split large constants file into chunks
Background I have a large constants & types file, graphql.ts, produced by https://github.com/dotansimha/graphql-code-generator . When analyzing the output of webpack's chunks, I get something like ...
0 votes
1 answer
65 views
CodeGen graphql returns type unkown
Here is my codeGen file const config: CodegenConfig = { schema: "http://localhost:3000/graphql", documents: ["core/shared/gql/**/*.ts"], // ignoreNoDocuments: true, // for ...
0 votes
1 answer
191 views
MockedProvider from @apollo/client/testing has issues with union types
Sorry if this post has a lot of code, but I feel like its necessary in order to get the full context. Bear in mind we are using Jest + @testing-library/react + @apollo/client/testing for testing, the ...
0 votes
1 answer
2k views
Aborting long-running Apollo Client queries in React component
I'm using Apollo Client(3.7.17) with React to fetch data. I'm facing an issue where I have a long-running query, and if the user navigates away before the query completes, I want to abort the request ...