Coder Social home page Coder Social logo

Comments (6)

fubhy avatar fubhy commented on May 26, 2024 4

We are also running into this (dotansimha/graphql-code-generator#6199).

The bug label was removed a few days ago. Is there a solution for how this can be fixed through config or why is this not considered a bug?

from graphql-code-generator-community.

jdmoody avatar jdmoody commented on May 26, 2024 1

I'm continuing to run into errors due to this issue and I'd love to see a fix for it 🙂

I'm in the process of incrementally migrating from Apollo code-generated typedefs to graphql-code-generator typedefs and this is the last issue that prevents full interoperability between the two.

To get this solved, we need to apply the optimizeDocuments method on the level of the loaders in graphql-tools, and allow to pass the flag there - this way it will allow us to optimize operations before codegen preset gets it.

I tried digging into the graphql-tools code to accomplish this, but I couldn't get it to work. It was a while ago and I was just hacking around in the built lib within my node_modules so I don't remember exactly what I tried 😅 I remember getting some errors about unknown or unrecognized fragments, I think 🤔

@dotansimha, @ardatan, are there any additional details or files you could point me to where the change should be made? I'd be happy to give it another try in a more rigorous way.

Thanks 🙏🏻

from graphql-code-generator-community.

dotansimha avatar dotansimha commented on May 26, 2024

The actual issue here is the fact that we are applying the flattenGeneratedTypes on the level of the plugin, after the preset has been executed and all operations has been splitted to separate output files.
That means, that we get a file for the fragment, and a file for the operation, but the operation needs to flatten the selection set and remove the fragment completely. Some kind of a race condition.

To get this solved, we need to apply the optimizeDocuments method on the level of the loaders in graphql-tools, and allow to pass the flag there - this way it will allow us to optimize operations before codegen preset gets it.

@ardatan fyi :)

from graphql-code-generator-community.

vladnkolesnikov avatar vladnkolesnikov commented on May 26, 2024

Up, have the same issue

from graphql-code-generator-community.

endophasie avatar endophasie commented on May 26, 2024

Yes, this is not solved yet

from graphql-code-generator-community.

Minho-Lee avatar Minho-Lee commented on May 26, 2024

Still having this issue.

from graphql-code-generator-community.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.