graphql-cache 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -3
- data/graphql-cache.gemspec +2 -1
- data/lib/graphql/cache.rb +10 -24
- data/lib/graphql/cache/middleware.rb +5 -1
- data/lib/graphql/cache/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 866eda70401ee7db7847f5b87cf8d0e2a9f26e5d21428c4338ee40ea143e8339
|
4
|
+
data.tar.gz: ebf01aa744da393e9beb14c0dd6f9da20d34752c515b72b2aba08ae295390a4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02a82cb8c0544cfe51fa6fc6e397b402008b851fa3ef31ab28bdfd7effec996ce350052ceb4dcf1e46f25dbba97988e1e39c3f9327788b7514cdf19dadc88a5a
|
7
|
+
data.tar.gz: a7dfbad849adb64e6c401634d32902ec3c78443032737c31961fa97508fc285753e264d0a1c4b856dea53c7d8d6cd32f56e8e70cc62be1a81d9e3dc13e490109
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
graphql-cache (0.2.
|
5
|
-
|
4
|
+
graphql-cache (0.2.2)
|
5
|
+
gemer (~> 0.1)
|
6
|
+
graphql (~> 1.8.0)
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
@@ -12,6 +13,7 @@ GEM
|
|
12
13
|
coderay (1.1.2)
|
13
14
|
diff-lcs (1.3)
|
14
15
|
docile (1.3.0)
|
16
|
+
gemer (0.1.2)
|
15
17
|
graphql (1.8.0)
|
16
18
|
json (2.1.0)
|
17
19
|
method_source (0.9.0)
|
@@ -51,4 +53,4 @@ DEPENDENCIES
|
|
51
53
|
simplecov
|
52
54
|
|
53
55
|
BUNDLED WITH
|
54
|
-
1.16.
|
56
|
+
1.16.2
|
data/graphql-cache.gemspec
CHANGED
data/lib/graphql/cache.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'gemer'
|
2
|
+
|
1
3
|
require 'graphql/cache/version'
|
2
4
|
require 'graphql/cache/middleware'
|
3
5
|
require 'graphql/cache/field'
|
@@ -5,30 +7,14 @@ require 'graphql/cache/marshal'
|
|
5
7
|
|
6
8
|
module GraphQL
|
7
9
|
module Cache
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
def self.force=(obj); @@force=obj; end
|
17
|
-
|
18
|
-
@@namespace = self.name
|
19
|
-
def self.namespace; @@namespace; end
|
20
|
-
def self.namespace=(obj); @@namespace=obj; end
|
21
|
-
|
22
|
-
@@cache = nil
|
23
|
-
def self.cache; @@cache; end
|
24
|
-
def self.cache=(obj); @@cache=obj; end
|
25
|
-
|
26
|
-
@@logger = nil
|
27
|
-
def self.logger; @@logger; end
|
28
|
-
def self.logger=(obj); @@logger=obj; end
|
29
|
-
|
30
|
-
def self.configure
|
31
|
-
yield self
|
10
|
+
include Gemer::Configurable
|
11
|
+
|
12
|
+
setup_config do |c|
|
13
|
+
c.attr :cache
|
14
|
+
c.attr :expiry, 5400
|
15
|
+
c.attr :force, false, in: [true, false]
|
16
|
+
c.attr :logger
|
17
|
+
c.attr :namespace, 'GraphQL::Cache'
|
32
18
|
end
|
33
19
|
|
34
20
|
def self.fetch(key, config: {}, &block)
|
@@ -21,8 +21,12 @@ module GraphQL
|
|
21
21
|
self.field_definition = field_definition
|
22
22
|
self.field_args = field_args
|
23
23
|
self.query_context = query_context
|
24
|
-
self.object = parent_object.object if parent_object
|
25
24
|
self.cache = ::GraphQL::Cache.cache
|
25
|
+
|
26
|
+
return unless parent_object
|
27
|
+
|
28
|
+
self.object = parent_object.nodes if parent_object.respond_to? :nodes
|
29
|
+
self.object = parent_object.object if parent_object.respond_to? :object
|
26
30
|
end
|
27
31
|
|
28
32
|
def cache_config
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Kelly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -94,20 +94,34 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: gemer
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.1'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.1'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: graphql
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
115
|
- - "~>"
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.8.0
|
117
|
+
version: 1.8.0
|
104
118
|
type: :runtime
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
122
|
- - "~>"
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version: 1.8.0
|
124
|
+
version: 1.8.0
|
111
125
|
description: Provides middleware field-level caching for graphql-ruby
|
112
126
|
email:
|
113
127
|
- michaelkelly322@gmail.com
|