-
Notifications
You must be signed in to change notification settings - Fork 93
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
Refactor transformation #259
Conversation
server/implementation/pom.xml
Outdated
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<version>5.6.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.vintage</groupId> | ||
<artifactId>junit-vintage-engine</artifactId> | ||
<version>5.6.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
|
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.
Do we have JUnit 5 yet ?
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.
It is at least already used in the client-implementation.
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.
Hi @ybroeker . Thanks for this. I am not sure "why?" though. eems like nothing have really changed i.t.o functionally ? Some decisions, that was made in the implementation has moved to the schema builder ? Why ?
There are some errors, There were still a few errors, like To fix this, the corresponding type needs to be known, so it is stored in the schema model. For example for Since both types are always known, shouldTransform can be simplified - just compare types instead keeping a list of types to transform. Also the transformers can be simplified a bit. And as a bonus, eclipse/microprofile-graphql#252 would be trivial to implement. |
Hi @ybroeker . Thanks for the explanation. So we should still be able to fix those cases without changing the model. Might be a bit more code, but I think the decision on how the transform work should stay in the impl. We might have to also check if this is a collection and then apply accordingly. W.r.t JUnit, we are waiting on the smallrye parent to release before we should use it. Let me check on that in the mean time. |
Do you see any disadvantages in keeping the information in the model as well? The matching type could be searched for at runtime, but I'm not sure if that would make things easier?
Collections worked correctly before, but there were errors with Array, which are fixed now..
JUnit 5 could also be easily reverted, this just makes some things easier. |
Hi @ybroeker - Apologies for taking so long to reply, I am on PTO at the moment, I'll look at this next week. |
Hey @ybroeker . Can you revert to JUnit 4 and look at the Conflicting files? Once fixed we can merge. |
…sformed to be understood by graphql-java
Signed-off-by: Yannick Bröker <[email protected]>
Signed-off-by: Yannick Bröker <[email protected]>
Signed-off-by: Yannick Bröker <[email protected]>
* Transform types when a transformation is required instead of keeping a list of types to transform * Specify concrete types for transformations. Makes code simpler (eg, use numbers directly instead of formatting->parsing->formatting->parsing) and more explicit * Handle chars correctly, char-inputs didn't work before * Handle BigInteger/BigDecimal correctly, previously those didn't work correctly if formatted (truncated to double or simply failing) * Handle arrays of formatted types correctly, didn't worked before * Build a foundation for eclipse/microprofile-graphql#251 Signed-off-by: Yannick Bröker <[email protected]>
6dc0803
to
6c806e1
Compare
Thanks @ybroeker ! |
Transform types when a transformation is required instead of keeping a list of types to transform
Specify concrete types for transformations. Makes code simpler (eg, use
numbers directly instead of formatting->parsing->formatting->parsing) and
more explicit
Handle chars correctly, char-inputs didn't work before (Testcase in Add some testcases eclipse/microprofile-graphql#252)
Handle BigInteger/BigDecimal correctly, previously those didn't work correctly if formatted (truncated to double or simply failing)
Handle arrays of formatted types correctly, didn't worked before (Testcase in Add some testcases eclipse/microprofile-graphql#252)
Build a foundation for Map a complex class to a scalar eclipse/microprofile-graphql#251