I spent some time trying to upgrade the HotChocolate workshop from version 11 to 13. If you are interested in the end result, check out my blog post here.
Most things still worked and a few things were marked as obsolete and easy to replace. However there was also some stuff that was less obvious. One error I got was when I tried to fetch a related object through a resolver.
Here is the GraphQL query I tried to execute:
And here is the error I got:
Let’s have a look at the resolver we were using:
And here is how it is used:
A look at the migration docs explained the problem.Starting from HotChocolate 12 the ParentAttribute
is required when a resolver argument is referring to the parent object.
So to fix the problem we have to update our resolver and introduce the ParentAttribute
: