graphql-guard 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +12 -6
- data/CHANGELOG.md +5 -1
- data/README.md +8 -0
- data/lib/graphql/guard.rb +1 -1
- data/lib/graphql/guard/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 34a246fe2de402bdd84f388a3469aee83b23bdafcd9225400c0fc3cd9506a383
|
|
4
|
+
data.tar.gz: 0efca01c24426cd0b1a35db070cabf37e6a50b0fd712dfd465eae567406ef920
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8c63963864a2a3a0aa7a2b7303e1cd1edde6719ea777403ec8ffe405f30da68eaee167745a4ea34ceddae3c5dce361161a36e5f8f3ffb0c6d6d838fe23887dc1
|
|
7
|
+
data.tar.gz: df4f04504dda1cb0cca0126c30c49356a776d8a58ccd36a5094f99e4294a7ea9c04007174c654e9bc72aad623244924a5cee3c2c9a1f785e5f7c9742dc3ad41e
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.6.1
|
data/.travis.yml
CHANGED
|
@@ -5,19 +5,25 @@ matrix:
|
|
|
5
5
|
include:
|
|
6
6
|
- gemfile: graphql-1.7.gemfile
|
|
7
7
|
env: GRAPHQL_RUBY_VERSION=1_7 CI=true
|
|
8
|
-
rvm: 2.3.
|
|
8
|
+
rvm: 2.3.8
|
|
9
9
|
- gemfile: graphql-1.8.gemfile
|
|
10
10
|
env: GRAPHQL_RUBY_VERSION=1_8 CI=true
|
|
11
|
-
rvm: 2.3.
|
|
11
|
+
rvm: 2.3.8
|
|
12
12
|
- gemfile: graphql-1.7.gemfile
|
|
13
13
|
env: GRAPHQL_RUBY_VERSION=1_7 CI=true
|
|
14
|
-
rvm: 2.4.
|
|
14
|
+
rvm: 2.4.5
|
|
15
15
|
- gemfile: graphql-1.8.gemfile
|
|
16
16
|
env: GRAPHQL_RUBY_VERSION=1_8 CI=true
|
|
17
|
-
rvm: 2.4.
|
|
17
|
+
rvm: 2.4.5
|
|
18
18
|
- gemfile: graphql-1.7.gemfile
|
|
19
19
|
env: GRAPHQL_RUBY_VERSION=1_7 CI=true
|
|
20
|
-
rvm: 2.5.
|
|
20
|
+
rvm: 2.5.3
|
|
21
21
|
- gemfile: graphql-1.8.gemfile
|
|
22
22
|
env: GRAPHQL_RUBY_VERSION=1_8 CI=true
|
|
23
|
-
rvm: 2.5.
|
|
23
|
+
rvm: 2.5.3
|
|
24
|
+
- gemfile: graphql-1.7.gemfile
|
|
25
|
+
env: GRAPHQL_RUBY_VERSION=1_7 CI=true
|
|
26
|
+
rvm: 2.6.1
|
|
27
|
+
- gemfile: graphql-1.8.gemfile
|
|
28
|
+
env: GRAPHQL_RUBY_VERSION=1_8 CI=true
|
|
29
|
+
rvm: 2.6.1
|
data/CHANGELOG.md
CHANGED
|
@@ -8,10 +8,14 @@ one of the following labels: `Added`, `Changed`, `Deprecated`,
|
|
|
8
8
|
to manage the versions of this gem so
|
|
9
9
|
that you can set version constraints properly.
|
|
10
10
|
|
|
11
|
-
#### [Unreleased](https://github.com/exAspArk/graphql-guard/compare/v1.2.
|
|
11
|
+
#### [Unreleased](https://github.com/exAspArk/graphql-guard/compare/v1.2.2...HEAD)
|
|
12
12
|
|
|
13
13
|
* WIP
|
|
14
14
|
|
|
15
|
+
#### [v1.2.2](https://github.com/exAspArk/graphql-guard/compare/v1.2.1...v1.2.2) – 2019-03-04
|
|
16
|
+
|
|
17
|
+
* `Fixed`: compatibility with Ruby 2.6 and `graphql` gem version 1.7. [#26](https://github.com/exAspArk/graphql-guard/pull/26)
|
|
18
|
+
|
|
15
19
|
#### [v1.2.1](https://github.com/exAspArk/graphql-guard/compare/v1.2.0...v1.2.1) – 2018-10-18
|
|
16
20
|
|
|
17
21
|
* `Fixed`: compatibility with Ruby 2.5 and `graphql` gem version 1.7. [#21](https://github.com/exAspArk/graphql-guard/pull/21)
|
data/README.md
CHANGED
|
@@ -120,6 +120,14 @@ class <b>GraphqlPolicy</b>
|
|
|
120
120
|
end
|
|
121
121
|
</pre>
|
|
122
122
|
|
|
123
|
+
With `graphql-ruby` gem version >= 1.8 and class-based type definitions, `type` doesn't return the actual type class [rmosolgo/graphql-ruby#1429](https://github.com/rmosolgo/graphql-ruby/issues/1429). To get the actual type class:
|
|
124
|
+
|
|
125
|
+
<pre>
|
|
126
|
+
def self.guard(type, field)
|
|
127
|
+
RULES.dig(<b>type.metadata[:type_class]</b>, field)
|
|
128
|
+
end
|
|
129
|
+
</pre>
|
|
130
|
+
|
|
123
131
|
Pass this object to `GraphQL::Guard`:
|
|
124
132
|
|
|
125
133
|
<pre>
|
data/lib/graphql/guard.rb
CHANGED
|
@@ -75,7 +75,7 @@ if GraphQL::ObjectType.respond_to?(:accepts_definitions) # GraphQL-Ruby version
|
|
|
75
75
|
GraphQL::Field.accepts_definitions(mask: GraphQL::Define.assign_metadata_key(:mask))
|
|
76
76
|
end
|
|
77
77
|
|
|
78
|
-
if
|
|
78
|
+
if defined?(GraphQL::Schema::Object) && GraphQL::Schema::Object.respond_to?(:accepts_definition) # GraphQL-Ruby version >= 1.8
|
|
79
79
|
GraphQL::Schema::Object.accepts_definition(:guard)
|
|
80
80
|
GraphQL::Schema::Field.accepts_definition(:guard)
|
|
81
81
|
GraphQL::Schema::Field.accepts_definition(:mask)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: graphql-guard
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- exAspArk
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2019-03-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: graphql
|
|
@@ -116,8 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
117
|
version: '0'
|
|
118
118
|
requirements: []
|
|
119
|
-
|
|
120
|
-
rubygems_version: 2.7.6
|
|
119
|
+
rubygems_version: 3.0.1
|
|
121
120
|
signing_key:
|
|
122
121
|
specification_version: 4
|
|
123
122
|
summary: Simple authorization gem for graphql-ruby
|