Client-side code generation
See original GitHub issueIs your feature request related to a problem? Please describe. Currently, the main purpose of the plugin is to generate server-side code (POJOs and interfaces). The idea is to add support of client-side classes generation. This will allow users to build a GraphQL request.
Describe the solution you’d like Schema example:
type Mutation {
newBike(bikeInput: BikeInput!): Bike
}
input BikeInput {
type: BikeType!
brand: String!
size: String!
price: BigDecimal
}
type Bike {
id: ID
type: BikeType
brand: String
size: String
price: BigDecimal
addedDateTime: DateTime
}
Generated class:
public class NewBikeMutationRequest {
private BikeInput bikeInput;
//getters/setters
}
public class BikeInputTO {
private BikeTypeTO type;
private String brand;
private String size;
private String price;
public BikeInputTO() { }
//getters/setters
The end-user will then use these classes to build the request and response projection (open question for now). So that it will be serialized to the following request string:
mutation newBike {
newBike(bike: {
type: ROAD,
brand: "LOL",
size: "Big",
year: 2019,
price: "123.45"
}) {
id
addedDateTime
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
[Tutorial & Sample] How to use OData Client Code Generator ...
[Tutorial & Sample] How to use OData Client Code Generator to generate client-side proxy class ; Start Visual Studio, from the TOOLS menu,...
Read more >How to Generate Client Code Based on Defined Tables
Login to Backendless Console, select your app and click the Code Generation icon. Select the client-side environment you will be working ...
Read more >API Code & Client Generator | Swagger Codegen
Codegen simplifies your build process by generating server stubs and client SDKs for any API defined with the OpenAPI specification. Download Codegen today....
Read more >Generate client side code using Swagger Codegen
Swagger codegen is the tool that we are going to use for generating client side code. You can simple download swagger codegen from...
Read more >Flexible Client-side QR Code Generator - CSS Script
Just another flexible, customizable, client-side QR code generator built using pure JavaScript. Also supports Java, Python, Rust, C, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, I was actually mentioning code generators in general. The one I heard about was for Swift I think.
Oh OK, so you want to build client queries in Java directly? That could be a way too, I just felt like the idea of this library was to go schema-first, so I expected a query-first solution here. But that implies parsing queries. I don’t know if the library you’re using can do this.
@JustinBlandford This feature is available in plugin version 1.6.0.
Please feel free to open an issue in this project or feature request if you have any suggestions/ideas. Thanks!