Open Felk opened 3 years ago
I suppose this is related to https://github.com/eclipse/microprofile-graphql/issues/94
I guess, at this point, you would also need to update the myEchoQuery
, your interceptor added the type, but did not update the query. As @t1 mentioned, we want to add a easy way to do this, but we have not yet gotten around to do it.
Any news on this?
No progress yet. PRs welcome :)
Any news on this?
No news, but you are welcome to provide a PR and we can discuss further there?
Any news on this?
Just to make it clear: it's easy to use custom scalars as return types with the @AdaptToScalar
annotation. But it's currently not possible to use as an Input... we'd need something like a @AdaptFromScalar
or so.
I need it precisely for ArrayList. Tried today some workarounds but no progress so far. If I manage to do something, I will get back to you,
Luckily, I found a workaround. For a reference I am using the quarkus implementation of the smallrye-graphql, but that shouldn't be much of a info, as it's build upon smallrye-graphql. I annotated the class with the annotation @Type
which makes my class "viewable" to the GraphQL schema. In my class beforehand I had ArrayList collection
and it was giving me the same error Type ArrayList not found in schema
. Now I changed it to List<String> collection
and that will only make my case work when transfering list of strings (which I am not completely satisfied with, but does the case for now). I would suggest to make a ScalarType Collection like we now have BigDecimal, String, etc.
I am having trouble getting a custom scalar to work properly. Since there does not appear to be first-class support for custom scalars in neither microprofile-graphql nor in smallrye-graphql I attempted to register a custom scalar using the underlying graphql-java library using the same name as the respective java class.
The custom scalar is very simple:
If I now try to use the custom scalar as-is, e.g. like this
I get the following error at quarkus compile time:
But I did not intend to use it as an
input
, I intended it to be used as a scalar. Weirdly enough, if I use e.g.YearMonth
I can use it as a scalar using the above method just fine:although I get this warning:
I am aware of
@ToScalar
but was wondering if there is a way to add a custom scalar so that it appears as a true custom GraphQL scalar in the schema instead of justString
?