Skip to content

Commit d2a2f79

Browse files
WIP Dataloader support
1 parent 91704e9 commit d2a2f79

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/graphql/fragment_cache/object_helpers.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ def cache_fragment(object_to_cache = NO_OBJECT, **options, &block)
4848

4949
fragment = Fragment.new(context_to_use, **options)
5050

51+
# TODO: spec
52+
if options[:dataloader]
53+
object_to_cache = block.call
54+
block = nil
55+
end
56+
5157
GraphQL::FragmentCache::Schema::LazyCacheResolver.new(fragment, context_to_use, object_to_cache, &block)
5258
end
5359
end

0 commit comments

Comments
 (0)