-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spring support for graphQl schema generator #33
base: master
Are you sure you want to change the base?
Conversation
create Configuration class for all relavant class - add to stg spring support - add parameter springModuleName - turn protected TypeProvider constructor to public - masked injector code from posts project
fix - masked injector code from posts project
fix 2 - masked injector code from posts project
create Configuration class for all relavant class
|
- masked injector code from posts project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really appreciate the PR! Overall, this looks like a great improvement.
@@ -4,16 +4,19 @@ | |||
<maven>3.0</maven> | |||
</prerequisites> | |||
|
|||
<groupId>com.distelli.graphql</groupId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the groupId
get inherited from the parent?
content); | ||
} else if (springModuleName != null && stGroup.isDefined("springModule") ) { | ||
PackageClassName packageClassName = getPackageClassName(springModuleName); | ||
final String body = " /*\n" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we simply put this in the string template file?
import graphql.language.TypeName; | ||
import graphql.language.UnionTypeDefinition; | ||
import graphql.language.Value; | ||
import graphql.language.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps your editor did this, but I'd prefer to avoid star imports :).
@@ -295,7 +307,7 @@ public class <model.name>TypeProvider implements Provider\<GraphQLInputObjectTyp | |||
.type(<it.graphQLType>) | |||
.name("<it.name>") | |||
<if(it.defaultValue)> | |||
.defaultValue(<it.defaultValue>) | |||
.defaultValue(<if(it.isStringValue)>"<it.defaultValue>"<else><it.defaultValue><endif>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should really fix the STModel
so that <it.defaultValue>
properly escapes as a string or number... specifically, if the default value is a string with a double quote, it won't generate correct code.
<if(model.idField)> | ||
@Bean | ||
public <model.packageName>.<model.name>.Resolver _<model.name>Resolver(){ | ||
return list -> list; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe Function.identity()
?
https://docs.oracle.com/javase/8/docs/api/java/util/function/Function.html#identity--
create Configuration class for all relavant class