smallrye-graphql
smallrye-graphql copied to clipboard
@Type's do not support arguments
smallrye supports arguments on top level query fields, but not on Types:
type Query {
parent: Nested #supported
parentWithArgs(with: String): Nested #supported
}
type Nested {
doThing: [String]! #supported
doThingWithArgs(with: String): [String]! #not supported
}
graphql should support arguments on any level of nested types
Hi @wishfoundry .
You can use @Source
to add a field like that.
(see https://download.eclipse.org/microprofile/microprofile-graphql-1.0.3/microprofile-graphql.html#fields)
Something like this:
@GraphQLApi
public class MyQueries {
@Query
public Nested getParent(){
// ...
}
public String doThingWithArgs(@Source Nested nested, String with) {
// ...
}
}
public class Nested {
private String doThing;
}
I think that it sometimes may be more convenient to add the parameterized field directly to the Type. IMHO we should keep this feature request open.