-
Notifications
You must be signed in to change notification settings - Fork 63
Closed
Description
Error when requesting self referencing 1-N relationship with connetion paging:
{
"errors": [
{
"message": "Field 'people' - When called from 'VisitLambda', rewriting a node of type 'System.Linq.Expressions.ParameterExpression' must return a non-null value of the same type. Alternatively, override 'VisitLambda' and change it to not visit children of this type."
}
]
}
How to reproduce
With demo project add properties to class Person
[JsonIgnore]
public Person? Parent { get; set; }
public List<Person> Children { get; set; } = [];
Configure ef core
builder.Entity<Person>().HasMany(p => p.Children).WithOne(a => a.Parent);
Configure connection paging
queryType.ReplaceField("people", db => db.People.OrderBy(e => e.Id), "Get a page of people").UseConnectionPaging();
Make a request with children property
{
people(first: 5) {
edges {
cursor
node { # this is your expected Movie context
id
name
children
{
id
name
}
}
}
pageInfo {
hasPreviousPage
hasNextPage
startCursor
endCursor
}
totalCount
}
}
Metadata
Metadata
Assignees
Labels
No labels