Skip to content

Disable parallel execution

Compare
Choose a tag to compare
@floyd-may floyd-may released this 11 Jan 22:25
· 65 commits to master since this release

This release disables the default of the underlying GraphQL-dotnet library which potentially runs queries in parallel. This is a dangerous default because:

  1. The default for EF Core is Scoped DbContexts, meaning that running with everything in a default configuration is invalid - EF Core DbContexts are not meant for concurrent access.
  2. Many cloud-based SQL offerings are very restrictive on the number of active connections. The number of connections that a single query might open becomes a function of the schema and the query.

To override this behavior, register graphql-dotnet's default DocumentExecuter as IDocumentExecuter:

services.AddSingleton<IDocumentExecuter, DocumentExecuter>();