Code generation from maven/gradle goals?
is it possible to generate java code (data model and Query, Mutation,... mappings) from the schema with a maven/gradle goal?
We don't offer build plugins at the moment. I assume this is about generating model classes and Query builders from a remote GraphQL schema, in order to use those in a GraphQL client?
If this is the case, we're working on a client implementation so we need to tackle #10 first and then consider this issue.
:+1: to this issue: we want to move away from DGS framework to Spring for Graphql, and we are using some Gradle DGS plugins to generate the client model.
This is not blocked anymore, so we need to discuss this as a team.
Doesn't the code generation make sense also for server?
Once I handwrite the graphql schema, it makes sense to me to generate at least DTOs for it. Is there any reason to not support code generation for server?
From: https://www.graphql-java.com/tutorials/getting-started-with-spring-boot/ Isn't writing
type Book {
id: ID
name: String
pageCount: Int
author: Author
}
and also
public class Book {
private String id;
private String name;
private int pageCount;
private String authorId;
public Book(String id, String name, int pageCount, String authorId) {
this.id = id;
this.name = name;
this.pageCount = pageCount;
this.authorId = authorId;
}
public String getId() {
return id;
}
public String getAuthorId() {
return authorId;
}
}
kind of duplicate?
We've discussed this as a team today and we came to the following conclusion: while we think this is a valid use case, we don't feel like this is a top priority for the project now. On the client side, we're working on interface clients to avoid the need for code generation. On the server side, we think that tooling provided by DGS and other libraries should be usable with a Spring for GraphQL project.
We might reconsider this feature for future releases, but for now we would like to focus on highly requested features like multipart, relay/pagination, observability, GraalVM native, nullability support, etc.
If you're still interested in this feature, feel free to upvote the original description. Thanks!