-
Notifications
You must be signed in to change notification settings - Fork 174
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
graphql.AssertException is being thrown where previously it wasn't #780
Comments
Hello! is there any updates on this? |
Hi @TsvetomirValchev, I am not sure it helps you, but I had a similar problem when using Hibernate. The issue was that the returned object was actually a Hibernate proxy object, that is a type subclassing the original interface, but not belonging to the set of subtypes GraphQL kickstart knows (since the proxy class is generated at runtime). If you use Hibernate lazy loading, or any other library that may proxy your original objects you might experience this strange issue. I am not sure if this is the case for you, but maybe a future reader is unblocked by my comment :) |
Hi @drewhk! Do you mind sharing how you fixed it ? I think you might have hit the spot for why this issue is happening but I could not work out a way to fix it. A colleague of mine previously told me there was a similar issue and it was something related to some libraries' interaction with Hibernate. |
So, in my case there was a GraphQL type |
Thank you for the fast response i will try this fix and will post an update if it fixed my issue as well! |
Description
With a schema like this
Previously we could execute a query like:
Now whenever there is an existing entry that is child of Questline in the database in the specific state that you query for, an error is thrown ( so let's say there is an entry in the database for EpicQuestline that has status ONGOING, if you query for status: ONGOING ) , it would throw an error:
Additional information:
A colleague of mine mentioned that this issue seems familiar to him and last time something like this was encountered the solution was somewhere in the dependency versions of hibernate-orm plugin and graphql-enhance plugin ( they were incompatible and once the versions were matched the issue was fixed.) This is currently not the case since i checked the versions of the aforementioned dependencies and it seems the issue is coming from somewhere else.
A list of all concrete Quest/Questline objects that inherit the Quest interface ( i.e. a list that has EpicQuestline and SpecificQuest from the example schema ).
A graphql.AssertException saying You have asked for named object type 'Questline' but it's not an object type but rather a 'graphql.schema.GraphQLInterfaceType' is thrown instead .
Steps to reproduce the bug
Have a similar schema
Have a query like:
Note:
The repository provided above might not have enough information. If you need more information please let me know and I will provide it to the best of my ability and ASAP.
Since this is one of the first ever github issues in my career please excuse my negligence!
The text was updated successfully, but these errors were encountered: