-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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]>
- Loading branch information
Showing
10 changed files
with
181 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
server/implementation/src/main/java/io/smallrye/graphql/transformation/CharTransformer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.smallrye.graphql.transformation; | ||
|
||
/** | ||
* Transforms between char and String. | ||
*/ | ||
public class CharTransformer implements Transformer<Character, String> { | ||
|
||
@Override | ||
public Character in(final String o) { | ||
return o.charAt(0); | ||
} | ||
|
||
@Override | ||
public String out(final Character o) { | ||
if (o == null) { | ||
return null; | ||
} | ||
return String.valueOf(o); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.