Coder Social home page Coder Social logo

[import-types-preset] Types should be imported only when the are external to the generated file about graphql-code-generator-community HOT 5 OPEN

jakubmazanec avatar jakubmazanec commented on June 6, 2024
[import-types-preset] Types should be imported only when the are external to the generated file

from graphql-code-generator-community.

Comments (5)

jakubmazanec avatar jakubmazanec commented on June 6, 2024 1

Here is GitHub repo: https://github.com/jakubmazanec/graphql-codegen-import-types-preset

npm install
npm run codegen

File output/operations.ts, lines 55-65 should show the issue.

Is this ok for reproduction? Thanks for finding time to look at this.

from graphql-code-generator-community.

dotansimha avatar dotansimha commented on June 6, 2024

Hi @jakubmazanec and thank you for the report!

Sorry but I'm not adding a lot here but just labeling it according to our new Contribution Guide and issue flow.

It seems like we are on stage 0.
Now in order to advance to stage 1 we'll need an easily running reproduction, do you think you can create that on code sandbox?

Thank you and sorry that this comment is not a complete solution (yet).

from graphql-code-generator-community.

dotansimha avatar dotansimha commented on June 6, 2024

I think initially this was intended to be typescript + typescript-operations in one file, and then typescript-react-apollo in another file with that preset, this way all types are prefixed. So this might be a use-case that isn't fully supported yet... PRs are always welcome!

from graphql-code-generator-community.

ProdigySim avatar ProdigySim commented on June 6, 2024

In my use, typescript-operations is generated based on the consumer query definitions, so it makes more sense for it to be colocated with typescript-react-apollo. Whereas typescript is generated solely from the GQL Schema. A solution to this issue would be helpful for me

from graphql-code-generator-community.

chazmuzz avatar chazmuzz commented on June 6, 2024

This problem still exists

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.