Skip to content

Commit 8e7700c

Browse files
committed
feat(Execution) add DeferredExecution, implement @stream and @defer
1 parent 01c1637 commit 8e7700c

File tree

13 files changed

+819
-4
lines changed

13 files changed

+819
-4
lines changed

lib/graphql/directive.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,7 @@ def on_operation?
4141
end
4242
end
4343

44+
require "graphql/directive/defer_directive"
4445
require "graphql/directive/include_directive"
4546
require "graphql/directive/skip_directive"
47+
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)