Skip to content

Commit 0d791df

Browse files
committed
feat(Execution) add DeferredExecution, implement @stream and @defer
1 parent e9cc6c5 commit 0d791df

File tree

13 files changed

+821
-4
lines changed

13 files changed

+821
-4
lines changed

lib/graphql/directive.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ def on_operation?
7676
end
7777
end
7878

79+
require "graphql/directive/defer_directive"
7980
require "graphql/directive/include_directive"
8081
require "graphql/directive/skip_directive"
8182
require "graphql/directive/deprecated_directive"
83+
require "graphql/directive/stream_directive"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
GraphQL::Directive::DeferDirective = GraphQL::Directive.define do
2+
name "defer"
3+
description "Push this part of the query in a later patch"
4+
locations([GraphQL::Directive::FIELD, GraphQL::Directive::FRAGMENT_SPREAD, GraphQL::Directive::INLINE_FRAGMENT])
5+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
GraphQL::Directive::StreamDirective = GraphQL::Directive.define do
2+
name "stream"
3+
description "Push items from this list in sequential patches"
4+
locations([GraphQL::Directive::FIELD])
5+
end

lib/graphql/execution.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
require "graphql/execution/deferred_execution"
12
require "graphql/execution/directive_checks"
23
require "graphql/execution/typecast"

0 commit comments

Comments
 (0)