Comments (5)
@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.
@mbossenbroek - could you please take a look when you get a chance?
from dgs-codegen.
@srinivasankavitha looks like the build passed on that PR; feel free to merge/release at your convenience
from dgs-codegen.
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.
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)
- generateJava fails with `Not a valid name: package` HOT 4
- Is the official document of generating codes outdated? or some classes are not auto-generated? HOT 1
- Generated Java-classes naming convention HOT 1
- Generating code from external schemas in JARs - META-INF requirement HOT 6
- Variable declaratino missing wenn miltiple operations are used
- Generate Deprecated Annotation For Queries HOT 1
- Fields with capital letters in the beginning are not deserialised by jackson. java
- Code is not compiling after aliases were added to projections HOT 3
- GraphQL interfaces should still be annotated when using the `@annotate` directive
- How to generate data class with "no arg constructor" and setter? (or a data class with builder) HOT 1
- Polymorphic Interfaces with default implementation HOT 3
- Support Custom Serialization for Date Fields in InputValueSerializer
- Error generating classes from generateClientApi or generateClientApiV2 HOT 9
- generating Java types failed with $ in graphql schema comment on interface
- Generating extended types that implement interfaces in the extension fails to generated the actual interface implementation HOT 1
- consider changing generateJava task name HOT 1
- gradle plugin not resolving dependencies properly HOT 1
- use instanceof in generated code
- use jakarta Generated HOT 3
- add appropriate nullity annotations HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dgs-codegen.