Custom scalar type #1164
Unanswered
ghermaniov
asked this question in
Q&A
Replies: 2 comments 5 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
-
AFAIK the client library does not support adding custom mappings (for now), but it shouldn't be a problem to add a feature where it will automatically consider |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello guys,
I am currenty using smallrye graphql client with Qarkus, trying to call Shopify GraphQL API. I got stuck on this one because they are using for "returnUrl" a scalar of type "URL", this one: https://shopify.dev/api/admin-graphql/2021-10/scalars/URL.
Is there a way I can define this custom scalar myself?
I found this open issue on github and from what I've seen this is not possible yet: microprofile/microprofile-graphql#94
Thanks.
Edit: I see both URL and URI from java are mapped to String in here: https://github.com/smallrye/smallrye-graphql/blob/main/common/schema-model/src/main/java/io/smallrye/graphql/schema/model/Scalars.java#L82
I guess this is the right way because most implementations will use a URL as String, maybe a way to re-map it to a custom defined one or a new annotation to specify a custom type that will be used when request is built, here:
smallrye-graphql/client/implementation/src/main/java/io/smallrye/graphql/client/impl/typesafe/QueryBuilder.java
Line 58 in cb91739
Beta Was this translation helpful? Give feedback.
All reactions