-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Description
Getting an error when trying to resolve service inside query when using UseConnectionPaging extension.
How to reproduce (demo project)
Define schema (something like #78):
demoScashema.Query().ReplaceField("people", "Get a page of people").Resolve<IHttpContextAccessor>((ctx, service) => ctx.People.Where(e => e.FirstName != service.HttpContext!.User.Identity!.Name)).UseConnectionPaging();Send request { people { edges { node { id } } } } and get error response:
{
"errors": [
{
"message": "Field 'people' - variable 'service' of type 'Microsoft.AspNetCore.Http.IHttpContextAccessor' referenced from scope '', but it is not defined"
}
]
}
Remove UseConnectionPaging and you will get no errors for { people { id } }
demoSchema.Query().ReplaceField("people", "Get a page of people").Resolve<IHttpContextAccessor>((ctx, service) => ctx.People.Where(e => e.FirstName != service.HttpContext!.User.Identity!.Name))Reactions are currently unavailable