-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore Interface on GraphQL Model Classes for Schemabuilder #503
Comments
Hi @michaelsonnleitner . I don't think at the moment that there is a way, you can try and use events (see https://quarkus.io/blog/experimental_graphql/#events-and-custom-execution) to manually remove that as a workaround for now. I'll keep this issue open and we can maybe look at supporting |
the real problem is that the schema parse can not deal with following model
getting following error on startup:
|
Ok, that is a different story. Yes that is not supported at the moment, but again, let's keep this issue open and add support for this. |
@michaelsonnleitner - can you create a reproducer ? That will fast track this. |
I have added it to following example. https://github.com/michaelsonnleitner/sample-async-graphql/blob/master/src/main/java/at/raiffeisen/graphql/Adress2nd.java Adress2nd is not referenced in my GraphQL Resource but indirectly referenced by https://github.com/michaelsonnleitner/sample-async-graphql/blob/master/src/main/java/at/raiffeisen/graphql/AdressCode.java following schema is generated:
It would be nice to add |
Ok cool. I would think that the |
yes and no ;) ignore on AdressCode would ignore any other class implementing it |
Ok, so if added to the interface, we also do not create the
part in the schema ? |
in my opinion not. but I am new in graphql |
mmm, But that would not make sense, if you add |
yes ignore and not add to schema (in my opinion) |
This requires a change in the spec to allow using the annotation on TYPE: |
Do I get this right: if the interface is |
I don't think we finalized on how this should work. Probably something that needs discussion on spec level |
Would be nice to have this. |
I've come across the same issue on a slightly different usecase. I have a type class that implements an interface and has subclasses for input. The input classes also appear as a type in the schema, even though they are never returned anywhere.
Generated schema:
The generated
throws this exception
|
I have following GraphQL Endpoint with following Java Model and Interface.
Is it possible to be able to tell the schemabuilder not to add all Types implementing AnyInterface to the schema.
eg. Cloneable and Serializable is not added to schema.
The text was updated successfully, but these errors were encountered: