Repository navigation
Conversation
Test ReportTest Results
Code Coverage (Java 25)
Changed Class Coverage (6 classes)
|
|
Hey @andimarek, thanks for working on this! I started looking at this for the spring-graphql adoption. I have a question about If I understand correctly, all list of variables share the same batch loading registry, but it looks like the actual loading doesn't end up in the same batch. Entries start one after another and each dispatches on its own, so entry 0 has already dispatched by the time entry 1 starts. In the "shared dataloaders use ordinary dispatch and cache repeated keys" it looks like there are two independent dispatches. I thought that the goal here would be to group them all? Is it possible to coordinate the dispatch across entries or maybe this doesn't fit the intent here? Thanks! |
|
Another think I've noticed. Calling Could In the graphql-over-http PR, the spec says "one execution per map", so in theory an empty list should produce zero executions and a singleton list should still get a batch response. Today an empty list runs the operation once with no variables (as far as I understand). I haven't implemented support yet, this comes just from a first round of review. |
Adds variable batching to the existing
ExecutionInput: execute the same selected operation once per variable map. This is execution-layer support for the variable batching proposal; it adds no HTTP or request batching behavior.variables(Map)becomes a singleton list. Empty lists execute once with empty variables; singletons retain ordinary execution. Larger lists execute once per complete map, including duplicates.getVariables()andgetRawVariables()assert that there is at most one map; usegetVariablesList()for batches.executeAsyncfor every entry, without waiting for earlier futures. There are no batch size/concurrency limits, scheduling, or backpressure.getResults()exposes the futures in input order;getResultsAsync()collects all results in that order. No threads are created by batching.IllegalArgumentExceptionas soon as the selected operation is known, before coercion or resolvers. Literal, cached, persisted, and rewritten documents are covered. Empty/singleton lists still support subscriptions.The new APIs are experimental. Serialize each individual
ExecutionResult; the batch has no single GraphQL response map.Validation: 158 focused tests pass across
VariableBatchExecutionTest,ExecutionInputTest,GraphQLTest, andParseAndValidateTest, including all 44 batching cases and the empty/singleton/multi-map accessor checks. Javadoc passes. The JMH benchmark compares batching with repeated executions sharing a registry.