ChilliCream/graphql-platform

Required external fields from other subgraphs return as null if it's a custom object type (Non standard scalar)

zhu302198 opened this issue · 3 comments

Product

Hot Chocolate

Version

13.6.1

Link to minimal reproduction

https://github.com/zhu302198/HC-example/blob/main/example.cs

Steps to reproduce

  1. Define the User type in one subgraph, with a field Profile marked as @external that comes from another subgraph.
  2. Use a ReferenceResolver to resolve the User type with both the UserId and the Profile.
  3. Attempt to query the User object across subgraphs, including the Profile field.
  4. Notice that scalar fields like UserId resolve, but the custom object type Profile is not resolved correctly.

What is expected?

The external Profile object should be correctly resolved across subgraphs, similar to how scalar fields (e.g., Guid) are resolved. The federated schema should be able to retrieve the Profile type’s username field for the User.

What is actually happening?

While scalar fields like Guid (e.g., UserId) are resolved correctly, custom object types like Profile, which are marked as @external, are not being resolved in the federated schema.

Relevant log output

No response

Additional context

No response

It works if you inject the data as ObjectValueNode instead.

It works if you inject the data as ObjectValueNode instead.

Do you have a code example of this? I tried to inject it as such, but still no luck. I do see that the entity is coming in within the IResolveContext I injected into the ReferenceResolver method, but I'd rather avoid parsing the context to get the entity