FieldScopedVariableResolver expect dictionary parent
See original GitHub issueDescribe the bug
When creating an extended stitched schema using the $fields
option during delegation won’t work if the type is from the extended schema and not a remote schema. This is because FieldScopedVariableResolver
expects context.Parent
to be IReadOnlyDictionary<string, object>
and not a regular C# object.
To Reproduce In a stitched schema extensions have something that looks like
extend type Query {
product(productKey: String!): Product!
}
type Product {
productKey: String!
orders(customerKey: String): [Order!]!
@delegate(schema: "commerce", path: "orders(productKey: $fields:productKey, customerKey: $arguments:customerKey)")
}
When executing a query that uses the above we see the message
Unable to cast object of type ‘Experiments.GraphQL.Schemas.Extensions.Product’ to type ‘System.Collections.Generic.IReadOnlyDictionary`2[System.String,System.Object]’.
Expected behavior Would expect the query to be able to use the Product field data in the delegated query.
Using Hot Chocolate 0.8.0
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
I will fix that in 0.8.1 so that we call the field resolver instead.
This one is outdated.