-
-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP defer support #3753
base: main
Are you sure you want to change the base?
WIP defer support #3753
Conversation
Reviewer's Guide by SourceryThis PR implements support for @defer and @stream directives. It introduces handling for multipart responses in subscriptions and modifies the GraphiQL HTML to use a newer version. Sequence diagram for incremental execution with @defersequenceDiagram
participant Client
participant Server
participant GraphQL
Client->>Server: Send GraphQL query with @defer
Server->>GraphQL: Execute query incrementally
GraphQL-->>Server: Return initial result
Server-->>Client: Send initial response
loop Subsequent Results
GraphQL-->>Server: Return deferred result
Server-->>Client: Send multipart response
end
Server-->>Client: Send end boundary
Class diagram for incremental execution resultsclassDiagram
class ExecutionResult
class ExperimentalIncrementalExecutionResults
class InitialIncrementalExecutionResult
class SubsequentIncrementalExecutionResult
class IncrementalResult
class IncrementalDeferResult
class IncrementalStreamResult
ExperimentalIncrementalExecutionResults --> InitialIncrementalExecutionResult
ExperimentalIncrementalExecutionResults --> SubsequentIncrementalExecutionResult
IncrementalResult <|-- IncrementalDeferResult
IncrementalResult <|-- IncrementalStreamResult
class IncrementalDeferResult {
+data
+errors
+path
+label
+extensions
}
class IncrementalStreamResult {
+items
+errors
+path
+label
+extensions
}
Flow diagram for multipart response handlingflowchart TD
A[Receive Query] --> B{Is Incremental?}
B -->|Yes| C[Process Initial Result]
C --> D[Send Initial Response]
D --> E[Process Subsequent Results]
E --> F{Has Next?}
F -->|Yes| E
F -->|No| G[Send End Boundary]
B -->|No| H[Process Normal Result]
H --> I[Send Response]
style B decision
style F decision
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
9e7d000
to
573fa72
Compare
CodSpeed Performance ReportMerging #3753 will improve performances by ×3.2Comparing Summary
Benchmarks breakdown
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3753 +/- ##
==========================================
- Coverage 97.27% 9.89% -87.38%
==========================================
Files 504 502 -2
Lines 33481 32353 -1128
Branches 5503 1671 -3832
==========================================
- Hits 32567 3202 -29365
- Misses 703 28995 +28292
+ Partials 211 156 -55 |
Worked on this with @bellini666
Still need to check:
Summary by Sourcery
Implement support for @defer directive. This allows deferring the execution of specific fields in a query, improving initial response times.
New Features:
@defer
directive, enabling deferred execution of selected fields within a query.Tests:
@defer
directive, covering basic functionality and multipart subscriptions.