Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Commit

Permalink
Bump gemer and handle nodes case
Browse files Browse the repository at this point in the history
  • Loading branch information
thebadmonkeydev committed May 19, 2018
1 parent 10a9b57 commit ccfcde4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PATH
specs:
graphql-cache (0.2.1)
gemer (~> 0.1)
graphql (~> 1.8.0.pre10)
graphql (~> 1.8.0)

GEM
remote: https://rubygems.org/
Expand All @@ -13,7 +13,7 @@ GEM
coderay (1.1.2)
diff-lcs (1.3)
docile (1.3.0)
gemer (0.1.1)
gemer (0.1.2)
graphql (1.8.0)
json (2.1.0)
method_source (0.9.0)
Expand Down
2 changes: 1 addition & 1 deletion graphql-cache.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ Gem::Specification.new do |s|
s.add_development_dependency 'simplecov'

s.add_dependency 'gemer', '~> 0.1'
s.add_dependency 'graphql', '~> 1.8.0.pre10'
s.add_dependency 'graphql', '~> 1.8.0'
end
6 changes: 5 additions & 1 deletion lib/graphql/cache/middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ def initialize(parent_type,
self.field_definition = field_definition
self.field_args = field_args
self.query_context = query_context
self.object = parent_object.object if parent_object
self.cache = ::GraphQL::Cache.cache

return unless parent_object

self.object = parent_object.nodes if parent_object.respond_to? :nodes
self.object = parent_object.object if parent_object.respond_to? :object
end

def cache_config
Expand Down

0 comments on commit ccfcde4

Please sign in to comment.