HotChocolate Fusion Compose incorrectly rewrites resolver
aidy-jenkins opened this issue · 2 comments
Product
Hot Chocolate
Version
14.1
Link to minimal reproduction
https://github.com/aidy-jenkins/FusionIssueReproduction/tree/resolver-rewrite
Steps to reproduce
Add a type extension with a custom resolver:
Pack and compose a fusion gateway as normal
What is expected?
A fusion schema should be generated which can make a downstream call using the given resolver.
e.g. for the following schema extension:
the query: query { foo { bars { id } }
should generate a query to foo
and then to barsByFoo
using the fooId from the first step.
What is actually happening?
The fusion schema incorrectly rewrites the resolver select to contain the name of the current resolver definition
(I have changed the name of the resolver here to someResolverName
to highlight that it has no bearing on the underlying resolver or the type name etc.)
When running a query plan against the gateway for the given query, we can see it's using the incorrect resolver to the downstream API:
We can see this has happened as a result of the fusion schema composition by unpacking the .fgp:
If we manually fix this in the composed schema and repack the .fgp, then the Gateway API works correctly, so it appears to just be a composition error
Relevant log output
Additional context
No response
The directive @resolver
is not supported. We planned for it in the beginning but have since dropped the idea.
Checkout the fusion docs: https://chillicream.com/docs/fusion/v14