public static IServiceCollection AddGraphQueryExeutionMiddleware(this IServiceCollection ServiceCollection, IGraphHttpRequestHandlerOptions Options) { ServiceCollection.AddSingleton(Options); // Performance Note: Singleton slows down Resolvers. Transienct will allow concurent execution of multiple Fields ServiceCollection.AddTransient <IGraphHttpRequestHandler, GraphHttpRequestHandler>(); return(ServiceCollection); }
public GraphHttpRequestHandler(IServiceProvider serviceProvider, IQueryExecutor queryExecutor, IDocumentCache documentCache, IDocumentHashProvider documentHashProvider, IGraphHttpRequestHandlerOptions graphHttpRequestHanlderOptions) : base(documentCache, documentHashProvider, graphHttpRequestHanlderOptions.MaxRequestSize, graphHttpRequestHanlderOptions.ParserOptions) { Executor = queryExecutor; ServiceProvider = serviceProvider; }