-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Background
I am trying to generate this query that has arguments passed to a subschema
query($fooId: String! $filter: BarFilter) {
foo(id: $fooId) {
id
... on FooBar {
bars(filter: $filter) {
name
}
}
}
}
Query Classes
public class FooQuery
{
// This works for binding the fooId
[GraphQLArguments("id", "String!", "fooId", isRequired: true, inlineArgument: false)]
[GraphQLUnionOrInterface("FooBar", typeof(FooBar))]
public Foo Foo { get; set; }
}
public class Foo
{
public string Id { get; set; }
}
public class FooBar : Foo
{
// This does not work
[GraphQLArguments("filter", "BarFilter", "filter", isRequired: true, inlineArgument: false)]
public IEnumerable<Bar> Bars { get; set; }
}
public class Bar
{
public string Name { get; set; }
}
Issue
When I supply the filter
it causes GraphQLArgumentVariableNotFoundException
with the message "The arguments with the following variables could not be found: filter".
var args = new GraphQLQueryArgument[]
{
new GraphQLQueryArgument("fooId", string.Empty),
new GraphQLQueryArgument("filter", new { }),
};
What the model generates
The model generates this query with the following arguments
query($fooId:String!) {
foo(id:$fooId) {
id
__typename
... on FooBar {
bars {
name
}
id
}
}
}
var args = new GraphQLQueryArgument[]
{
new GraphQLQueryArgument("fooId", string.Empty),
};
Metadata
Metadata
Assignees
Labels
No labels