Code Monkey home page Code Monkey logo

Comments (5)

mbossenbroek avatar mbossenbroek commented on July 2, 2024 1

@JLLeitschuh you're right - when creating the projections I was converting the type to kotlin first & then deriving the name of the projection by picking the innermost type. Obviously this failed if it found a mapped generic type & picked the inner type of the edge instead of the connection.

This should fix it by looking instead at the name of the GQL type itself for determining the name of the projection, effectively ignoring the mapped types when building the client. I updated one of the examples to use the relay mapping as well to confirm the behavior: #642

from dgs-codegen.

srinivasankavitha avatar srinivasankavitha commented on July 2, 2024

@mbossenbroek - could you please take a look when you get a chance?

from dgs-codegen.

mbossenbroek avatar mbossenbroek commented on July 2, 2024

@srinivasankavitha looks like the build passed on that PR; feel free to merge/release at your convenience

from dgs-codegen.

JLLeitschuh avatar JLLeitschuh commented on July 2, 2024

Does SimpleListConnection work for client types? I'm hoping it does.

Also, couldn't DGS automatically detect pagination structures and auto-generate the correct paginated API for the model types?

from dgs-codegen.

mbossenbroek avatar mbossenbroek commented on July 2, 2024

I'm not sure I follow what you mean by this:

Does SimpleListConnection work for client types?

You can specify that you'd like to use that class instead of the generated ones & it will put it in there. As to whether or not it deserializes correctly depends on the json library you're using.

Also, couldn't DGS automatically detect pagination structures and auto-generate the correct paginated API for the model types?

There is no specified "correct" paginated type as GQL doesn't specify that sort of thing. There are the relay types you found, which can certainly be used, but they have some faults of their own. Namely, they won't differentiate between explicit null fields and those that are simply not requested. Left alone, the code-gen will generate the appropriate pagination structures for a client without having to involve the relay classes.

from dgs-codegen.

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.