-
Notifications
You must be signed in to change notification settings - Fork 1.4k
near-operation-file-preset
with typescript-operations
not working after upgrade of dependencies to latest version
#10241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @Dominik-Reinert , I've tried looking at the reproduction but don't see a setup similar to yours. Could you please update that to help me understand where the issue might be? If that cannot be done, here's some steps to self-debug:
|
hey @eddeee888 sorry I seem to have shared a wrong link 🤔 here is a fork that I hopefully saved correctly: https://stackblitz.com/edit/github-mfybgazf-1f1ckv15?file=codegen.ts |
@eddeee888 is this actually what you were asking about? |
Hi @Dominik-Reinert ,
After running, I can see it finishes very quickly without being stuck. Could you check for yourself to make sure the reproduction works correctly for you as well? |
hey @eddeee888 I removed the extra libraries and checked for differences applied in your solution. I reran the generation, but it never finishes. see here: simplescreenrecorder-2025-02-03_15.15.55.mp4 |
Hi @Dominik-Reinert , is the screen recording running the code in reproduction repo? Nothing jumps out as unusual in the codegen config you've shared. Maybe you could try narrowing the documents to just one file to see if it fixes it? |
Hey @eddeee888, first off: thanks for still following along 🙂 It is failing on my local machine and on github CI. Also across Linux and Mac systems. As written in the description:
Removing the documents only works if I remove all documents... 😅 Is there no way to get more useful output logs than the few logs I added in the description? |
Hi @Dominik-Reinert , Unfortunately, I've got a feeling this may have something to do with your specific combination of schema and documents. |
hey @eddeee888 adding logs to the node modules files could be a good starting point 🤔 Based on the things written here, do you have an entry point where you would expect an issue to happen? 🙂 I narrowed down the generation of types to just a handful of queries and mutations, but it still never finishes. As stated in the PR description already though,
and that is still the case 😕 |
If
|
Which packages are impacted by your issue?
@graphql-codegen/typescript-operations
Describe the bug
Hey folks,
I am trying to upgrade the codegen dependencies from
to the latest version of the respective dependencies.
on the old dependencies, the code generation works fine.
on the new versions however, the generation never finishes.
Running the generation with the
--debug
flag gives the following output:I narrowed down the problem to the
near-operation-file
in combination with thetypescript-operations
. when removing the operations plugin, the generation works again, but my app is broken as the typescript operations are not generated anymoreAnyone has an idea, what might be causing this?
It is not:
Your Example Website or App
https://stackblitz.com/github/dotansimha/graphql-code-generator-issue-sandbox-template?file=codegen.ts
Steps to Reproduce the Bug or Issue
I dont know, just update the dependencies and run the script as usual
Expected behavior
As a user, I would expect to
Screenshots or Videos
No response
Platform
OS: Linux, github actions
NodeJS: 18
graphql
version: 16.6Codegen Config File
import {type CodegenConfig} from '@graphql-codegen/cli';
export const generationConfig = {
dedupeFragments: true,
maybeValue: 'T | null',
namingConvention: 'keep',
defaultScalarType: 'string',
arrayInputCoercion: false,
scalars: {
BigDecimal: 'number',
},
};
const config: CodegenConfig = {
schema: 'schema.graphql',
documents: [
'./app//queries.ts',
'./app//fragments.ts',
'./app//shared-queries/*',
'./app//shared-fragments/',
'./app/**/.query.ts',
'./app//*.fragment.ts',
'./app//*.mutation.ts',
],
generates: {
'./app/util/graphql/api-types.ts': {
plugins: ['typescript'],
config: generationConfig,
},
'./app/': {
preset: 'near-operation-file',
presetConfig: {
baseTypesPath: 'util/graphql/api-types.ts',
extension: '.api-types.ts',
cwd: './',
folder: 'generated',
},
plugins: ['typescript-operations'],
config: generationConfig,
},
'./bin/generated-schema-introspection.json': {
plugins: ['introspection'],
},
},
};
export default config;
Additional context
No response
The text was updated successfully, but these errors were encountered: