0

Is there a way to intercept a query that is passed from the (BananaCakePop/Hotchocolate) playground and read the contents of it?

Currently I am trying to use IHttpContextAccessor httpContext in my resolver which is injected after configuring my services in Startup.cs ->services.AddHttpContextAccessor();

public async Task<IEnumerable<Account>> MyResolver(
        [Service] IHttpContextAccessor httpContext,
        [Service] IConfigService configService)

However I am not able to see my query in the request.

Is there something that I am missing here?

Harobed
  • 145
  • 1
  • 13

1 Answers1

-1

If you want to read the document you can just inject IResolverContext and access the Document

public async Task<IEnumerable<Account>> MyResolver(
        [Service] IHttpContextAccessor httpContext,
        [Service] IConfigService configService,
        IResolverContext resolverContext) 
{
   resolverContext.Document <---
}
Pascal Senn
  • 1,712
  • 11
  • 20