Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

spring support for graphQl schema generator #33

wants to merge 6 commits into from

Conversation

PeretzNadav
Copy link

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

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
@PeretzNadav
Copy link
Author

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

@PeretzNadav PeretzNadav reopened this Jan 28, 2019
Copy link
Contributor

@brimworks brimworks left a 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>
Copy link
Contributor

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" +
Copy link
Contributor

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.*;
Copy link
Contributor

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>)
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants