graphiti_gql 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d9dda0537212e47943587af28d28226e8ee6a4ad0d91b65f5074003ab370f17
4
- data.tar.gz: 222fb453e4f73c6e4d0de606bae88aea041b23c48ba28355f575025dff7e3c92
3
+ metadata.gz: 84a7ebf615007ac087b7bab32e53b78fc1bbdb7abcd9d65e38beac1ec7e578fc
4
+ data.tar.gz: d5c625d0e34f750d8fc3bc8c71f39ccabb70aa1c87340978620e965137e15feb
5
5
  SHA512:
6
- metadata.gz: 8e5a6a8d98b058fb8237750190e6f051712d2f90f5bf49be615f68a594598589afb1811aec0f0fbe79bbcefd457d27a6cf78e84e8e90d539168da9ffd13b9a64
7
- data.tar.gz: 6515ba7accff3edb9490028bc3545f649d2a33877f5d6eb77a32a9183e365241be56b3ba6b99b1c27095390c110ee3c3f7d6743844049dab6576461b22a64c7c
6
+ metadata.gz: e8ea8defdb4712239187bcbb14a0d5dbeee9e52bf11a7c32dd747da2eae62247ef66fda15dd63b57886920a895f8215fe7a33b8eb3dc156194b3b2e3fd2f75c6
7
+ data.tar.gz: 42f885befb9c54a6b915642e40f2d2bb8704571c901c392f2a6fe11196d805113ca7af546ff15db7b336fdceff172ba2c27e9f443381462db26b4b44461eab6b
@@ -12,9 +12,27 @@ module GraphitiGql
12
12
  :stats
13
13
 
14
14
  if defined?(RSpec)
15
- let(:params) { {} }
15
+ let(:params) do
16
+ fields = []
17
+ resource.attributes.each_pair do |name, config|
18
+ (fields << name) if config[:readable]
19
+ end
20
+ { fields: fields }
21
+ end
16
22
  let(:resource) { described_class }
17
23
  let(:ctx) { {} }
24
+
25
+ def self.only_fields(*fields)
26
+ before do
27
+ fields.each { |f| params[:fields].select! { |p| p == f } }
28
+ end
29
+ end
30
+
31
+ def self.except_fields(*fields)
32
+ before do
33
+ fields.each { |f| params[:fields].reject! { |p| p == f } }
34
+ end
35
+ end
18
36
  end
19
37
  end
20
38
 
@@ -1,3 +1,3 @@
1
1
  module GraphitiGql
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphiti_gql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-29 00:00:00.000000000 Z
11
+ date: 2022-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql
@@ -108,7 +108,7 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '7.0'
111
- description:
111
+ description:
112
112
  email:
113
113
  - richmolj@gmail.com
114
114
  executables: []
@@ -169,7 +169,7 @@ licenses:
169
169
  - MIT
170
170
  metadata:
171
171
  homepage_uri: https://www.graphiti.dev
172
- post_install_message:
172
+ post_install_message:
173
173
  rdoc_options: []
174
174
  require_paths:
175
175
  - lib
@@ -184,8 +184,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  - !ruby/object:Gem::Version
185
185
  version: '0'
186
186
  requirements: []
187
- rubygems_version: 3.3.7
188
- signing_key:
187
+ rubygems_version: 3.0.3.1
188
+ signing_key:
189
189
  specification_version: 4
190
190
  summary: GraphQL support for Graphiti
191
191
  test_files: []