Including types that have no fields cause validation errors #978
Replies: 4 comments 9 replies
-
Typically when we want different input/output objects we use one model and annotate the relevant getters (for output) and setters (for input)/ Saying that, what you describe should also work, so maybe create a small reproducer I can look at, it's probably a bug |
Beta Was this translation helpful? Give feedback.
-
here is a reproducer for the interface no fields issue https://github.com/mswiderski/smallrye-graphql-reproducer let me know if there is anything else to do from my end. |
Beta Was this translation helpful? Give feedback.
-
@mswiderski - ok , I think we have multiple issues here. I'll reply here as I go For the empty Model interface that you have, we probably need to support the
see http://spec.graphql.org/draft/#sel-HAHbnBFBABABwBrqE There is already a request to allow |
Beta Was this translation helpful? Give feedback.
-
@mswiderski - Do you have a reproducer for the "added twice" issue ? |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am starting to work on building GraphQL for my services and run into a issue that I believe is caused by scaling all possible implementation of the interface and even adding the interface that can be just a marker interface - meaning no fields.
Here is a bit more context into the issue
Model
InvoiceInputModel
andInvoiceOutputModel
So the first problem is that all of a sudden it fails with
the problem seems to be caused by the fact that
InvoiceInputModel
is added twice - once when found as argument where it is added properly as input type to the schema, but then it is added once again as type based on scanning of theModel
interface.Here I have first question - why is this actually happening? Shall it check if given type was already processed or at least check its annotation (as
InvoiceInputModel
is annotated withInput
)?I workaround it by removing model interface from the
InvoiceInputModel
and then it failed with another validation errorHere I actually made a change in the SchemaBuilder to only add types that actually have fields or values (for enum). This allowed me to start the GraphQL service and it works nicely.
With that I'd like to ask about few things:
SchemaBuilder
to skip types that do not have fields - is it ok or there should be different approach?Any and all comments and hints are more needed :)
Beta Was this translation helpful? Give feedback.
All reactions