graphql_connector 0.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yaml +37 -0
- data/.rspec +1 -0
- data/.rubocop_todo.yml +3 -0
- data/CHANGELOG.md +38 -9
- data/Gemfile.lock +30 -30
- data/README.md +155 -13
- data/examples/departments_service_class_examples.rb +51 -0
- data/examples/mutation_examples.rb +17 -0
- data/examples/query_examples.rb +21 -0
- data/examples/raw_query_examples.rb +24 -0
- data/graphql_connector.gemspec +7 -7
- data/lib/graphql_connector.rb +10 -21
- data/lib/graphql_connector/base_server_type.rb +62 -0
- data/lib/graphql_connector/configuration.rb +14 -3
- data/lib/graphql_connector/formatters/base_format.rb +81 -0
- data/lib/graphql_connector/formatters/mutation_format.rb +14 -0
- data/lib/graphql_connector/formatters/query_format.rb +14 -0
- data/lib/graphql_connector/http_client.rb +49 -0
- data/lib/graphql_connector/service_classable/class_method_validator.rb +31 -0
- data/lib/graphql_connector/service_classable/params_validator.rb +24 -0
- data/lib/graphql_connector/service_classable/queryable.rb +108 -0
- data/lib/graphql_connector/service_classable/return_fields_validator.rb +43 -0
- data/lib/graphql_connector/version.rb +1 -1
- metadata +27 -27
- data/.travis.yml +0 -9
- data/lib/graphql_connector/query_builder.rb +0 -59
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5e948edafea5975fe63377a5da8f4ca6d01d9876393a811da385b3d3f07fa88
|
4
|
+
data.tar.gz: 8aa20c39ae60c975e8e17fb1b54e8715a39d2be4f536d1e6df053a93208096b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3a49cf0f8be6bbb061d29e34a5224c76f287c84a9fc2a9af51ba3c4475a043cb0321870ecd59ee027be111335a961b9ec55f609a5721429cabfb5897af5d4ed
|
7
|
+
data.tar.gz: f051786162a0f05136acc59d1682012c54c1d2d306f3e9284a8136b70be80410b101731c2c608d71d1f600101df0f0427917c0777c9ae725c1ebb8e1bee4bf80
|
@@ -0,0 +1,37 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
strategy:
|
9
|
+
matrix:
|
10
|
+
ruby: ['2.4.10', '2.5.9', '2.6.7', '2.7.3', '3.0.1']
|
11
|
+
name: "ruby ${{ matrix.ruby }}"
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v1
|
14
|
+
- uses: ruby/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: ${{ matrix.ruby }}
|
17
|
+
- name: Install dependencies
|
18
|
+
run: |
|
19
|
+
gem install bundler
|
20
|
+
bundle install
|
21
|
+
- name: Run Test with rspec
|
22
|
+
run: bundle exec rspec spec
|
23
|
+
rubocop:
|
24
|
+
name: Rubocop
|
25
|
+
runs-on: ubuntu-latest
|
26
|
+
steps:
|
27
|
+
- uses: actions/checkout@v2
|
28
|
+
- uses: ruby/setup-ruby@v1
|
29
|
+
with:
|
30
|
+
ruby-version: 2.7.3
|
31
|
+
- name: Install dependencies
|
32
|
+
run: |
|
33
|
+
gem install bundler
|
34
|
+
bundle install
|
35
|
+
- name: Build and test
|
36
|
+
run: |
|
37
|
+
bundle exec rubocop
|
data/.rspec
CHANGED
data/.rubocop_todo.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,18 +1,47 @@
|
|
1
|
+
## 1.2.1 (2021-05-25)
|
1
2
|
|
2
|
-
|
3
|
+
* relax httparty dependency(`~> 0.17` => `~> 0.16`)
|
3
4
|
|
4
|
-
|
5
|
+
## 1.2.0 (2020-12-22)
|
6
|
+
|
7
|
+
### Features
|
8
|
+
* Add `mutation` under server namespace and service class inclusion
|
9
|
+
* See `README` for details
|
10
|
+
|
11
|
+
## 1.1.1 (2020-5-04)
|
12
|
+
|
13
|
+
### BugFix
|
14
|
+
* Omit invalid `()` for empty conditions in `query` method
|
15
|
+
|
16
|
+
## 1.1.0 (2020-4-19)
|
17
|
+
|
18
|
+
### Features
|
19
|
+
* Allow building graphql querying in custom classes via `service class inclusion`
|
20
|
+
* See `README` for details about `service class inclusion`
|
21
|
+
|
22
|
+
### BugFix
|
23
|
+
* Forward `variables` when performing a `raw_query`
|
24
|
+
|
25
|
+
## 1.0.0 (2020-1-26)
|
26
|
+
|
27
|
+
### Breaking
|
28
|
+
* add multiple graphql server querying
|
29
|
+
* `query` and `raw_query` nested under server namespace
|
30
|
+
|
31
|
+
|
32
|
+
## 0.2.0 (2019-11-19)
|
33
|
+
|
34
|
+
### Features
|
5
35
|
* new `raw_query` method. you have to write the graphql query
|
6
|
-
string by your self and also you get only the parsed json back.
|
36
|
+
string by your self and also you get only the parsed json back.
|
7
37
|
* query supports associations for the selected_fields attribute
|
8
38
|
|
39
|
+
## 0.1.0.beta1 (2019-10-06)
|
9
40
|
|
10
|
-
###
|
11
|
-
|
12
|
-
** BugFix
|
13
|
-
use model instead of hardcoded product
|
41
|
+
### BugFix
|
42
|
+
* use model instead of hardcoded product
|
14
43
|
|
15
44
|
|
16
|
-
|
45
|
+
## 0.1.0.beta (2019-10-03)
|
17
46
|
|
18
|
-
easy graphql logic
|
47
|
+
* easy graphql logic
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
graphql_connector (
|
5
|
-
httparty (~> 0.
|
4
|
+
graphql_connector (1.2.0)
|
5
|
+
httparty (~> 0.16)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
@@ -10,45 +10,46 @@ GEM
|
|
10
10
|
ast (2.4.0)
|
11
11
|
coderay (1.1.2)
|
12
12
|
diff-lcs (1.3)
|
13
|
-
httparty (0.
|
13
|
+
httparty (0.18.1)
|
14
14
|
mime-types (~> 3.0)
|
15
15
|
multi_xml (>= 0.5.2)
|
16
|
-
jaro_winkler (1.5.
|
17
|
-
method_source (0.
|
18
|
-
mime-types (3.3)
|
16
|
+
jaro_winkler (1.5.4)
|
17
|
+
method_source (1.0.0)
|
18
|
+
mime-types (3.3.1)
|
19
19
|
mime-types-data (~> 3.2015)
|
20
|
-
mime-types-data (3.
|
20
|
+
mime-types-data (3.2021.0225)
|
21
21
|
multi_xml (0.6.0)
|
22
|
-
parallel (1.
|
23
|
-
parser (2.
|
22
|
+
parallel (1.19.1)
|
23
|
+
parser (2.7.1.1)
|
24
24
|
ast (~> 2.4.0)
|
25
|
-
pry (0.
|
26
|
-
coderay (~> 1.1
|
27
|
-
method_source (~>
|
25
|
+
pry (0.13.1)
|
26
|
+
coderay (~> 1.1)
|
27
|
+
method_source (~> 1.0)
|
28
28
|
rainbow (3.0.0)
|
29
|
-
|
30
|
-
rspec (3.
|
31
|
-
rspec-core (~> 3.
|
32
|
-
rspec-expectations (~> 3.
|
33
|
-
rspec-mocks (~> 3.
|
34
|
-
rspec-core (3.
|
35
|
-
rspec-support (~> 3.
|
36
|
-
rspec-expectations (3.
|
29
|
+
rexml (3.2.5)
|
30
|
+
rspec (3.9.0)
|
31
|
+
rspec-core (~> 3.9.0)
|
32
|
+
rspec-expectations (~> 3.9.0)
|
33
|
+
rspec-mocks (~> 3.9.0)
|
34
|
+
rspec-core (3.9.1)
|
35
|
+
rspec-support (~> 3.9.1)
|
36
|
+
rspec-expectations (3.9.1)
|
37
37
|
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
-
rspec-support (~> 3.
|
39
|
-
rspec-mocks (3.
|
38
|
+
rspec-support (~> 3.9.0)
|
39
|
+
rspec-mocks (3.9.1)
|
40
40
|
diff-lcs (>= 1.2.0, < 2.0)
|
41
|
-
rspec-support (~> 3.
|
42
|
-
rspec-support (3.
|
43
|
-
rubocop (0.
|
41
|
+
rspec-support (~> 3.9.0)
|
42
|
+
rspec-support (3.9.2)
|
43
|
+
rubocop (0.82.0)
|
44
44
|
jaro_winkler (~> 1.5.1)
|
45
45
|
parallel (~> 1.10)
|
46
|
-
parser (>= 2.
|
46
|
+
parser (>= 2.7.0.1)
|
47
47
|
rainbow (>= 2.2.2, < 4.0)
|
48
|
+
rexml
|
48
49
|
ruby-progressbar (~> 1.7)
|
49
|
-
unicode-display_width (>= 1.4.0, <
|
50
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
50
51
|
ruby-progressbar (1.10.1)
|
51
|
-
unicode-display_width (1.
|
52
|
+
unicode-display_width (1.7.0)
|
52
53
|
|
53
54
|
PLATFORMS
|
54
55
|
ruby
|
@@ -57,9 +58,8 @@ DEPENDENCIES
|
|
57
58
|
bundler (~> 2.0)
|
58
59
|
graphql_connector!
|
59
60
|
pry (~> 0.10)
|
60
|
-
rake (~> 10.0)
|
61
61
|
rspec (~> 3.8)
|
62
62
|
rubocop (~> 0.75)
|
63
63
|
|
64
64
|
BUNDLED WITH
|
65
|
-
2.
|
65
|
+
2.1.4
|
data/README.md
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
+
|
1
2
|
# GraphqlConnector
|
2
3
|
|
3
4
|
[](https://badge.fury.io/rb/graphql_connector)
|
5
|
-
[](https://github.com/Garllon/graphql_connector/actions?query=workflow%3ACI)
|
7
|
+
[](https://codeclimate.com/github/Garllon/graphql_connector/maintainability)
|
7
8
|
|
8
9
|
An easy connector to call your `graphql` server. Currently there is no schema
|
9
|
-
check in the code, but i will add
|
10
|
+
check in the code, but i will add it.
|
10
11
|
|
11
12
|
## Installation
|
12
13
|
|
@@ -29,23 +30,39 @@ Or install it yourself as:
|
|
29
30
|
You need to configure the `graphql_connector` first:
|
30
31
|
``` ruby
|
31
32
|
GraphqlConnector.configure do |config|
|
32
|
-
config.
|
33
|
-
config.headers = {}
|
33
|
+
config.add_server(name: 'Foo', uri: 'http://foo.com/api/graphql', headers: {})
|
34
34
|
end
|
35
35
|
```
|
36
36
|
|
37
|
+
For each graphql server you wish to query use `add_server`.
|
38
|
+
|
39
|
+
Afterwards you will have the following options to fetch and/or mutate data with
|
40
|
+
one or many graphql servers:
|
41
|
+
|
42
|
+
* `raw_query` --> [Examples](examples/raw_query_examples.rb)
|
43
|
+
* `query` --> [Examples](examples/query_examples.rb)
|
44
|
+
* `mutation` --> [Examples](examples/mutation_examples.rb)
|
45
|
+
* `service class inclusion` --> [Examples](examples/departments_service_class_examples.rb)
|
46
|
+
|
47
|
+
See the following sub sections for details
|
48
|
+
|
37
49
|
### raw_query
|
38
50
|
|
39
|
-
|
51
|
+
You can call your graphql_endpoint via:
|
40
52
|
```ruby
|
41
|
-
GraphqlConnector
|
53
|
+
GraphqlConnector::<name>.raw_query(query_string)
|
42
54
|
```
|
43
55
|
|
56
|
+
Note that `<name>` has to be replaced by any of the ones added via `add_server`
|
57
|
+
|
58
|
+
See also [here](examples/raw_query_examples.rb) for example usage
|
59
|
+
|
60
|
+
---
|
44
61
|
### query
|
45
62
|
|
46
|
-
|
63
|
+
You can also use the more comfortable `query`:
|
47
64
|
```ruby
|
48
|
-
GraphqlConnector
|
65
|
+
GraphqlConnector::<name>.query(model, condition, selected_fields)
|
49
66
|
```
|
50
67
|
|
51
68
|
| Variable | DataType | Example |
|
@@ -57,11 +74,13 @@ GraphqlConnector.query(model, condition, selected_fields)
|
|
57
74
|
> Caution:
|
58
75
|
> You get an OpenStruct back. Currently only the first level attributes are
|
59
76
|
> supported with OpenStruct, associated objects are still a normal array of
|
60
|
-
> hashes.
|
77
|
+
> hashes.
|
78
|
+
|
79
|
+
See also [here](examples/query_examples.rb) for example usage
|
61
80
|
|
62
81
|
#### selected_fields
|
63
82
|
|
64
|
-
The
|
83
|
+
The syntax for the associations looks like the following:
|
65
84
|
```
|
66
85
|
['<attribute_name>', <association_name>: ['<attribute_name_of_the_association>']]
|
67
86
|
```
|
@@ -71,6 +90,129 @@ Example:
|
|
71
90
|
['id', 'name', productCategory: ['id', 'name']]
|
72
91
|
```
|
73
92
|
|
93
|
+
---
|
94
|
+
|
95
|
+
### mutation
|
96
|
+
|
97
|
+
Works in the same way as [query](#query)
|
98
|
+
|
99
|
+
See also [here](examples/mutation_examples.rb) for example usage
|
100
|
+
|
101
|
+
### Service class inclusion
|
102
|
+
|
103
|
+
This approach can be used to `graphqlize` **any** kind of ruby (service) class
|
104
|
+
so that it has re-usable graphql `query` and `mutation` **class methods**.
|
105
|
+
|
106
|
+
* First add `extend GraphqlConnector::<server>::Query` in the the class(es) that should be `graphqlized`
|
107
|
+
|
108
|
+
* Then you can aliases as many graphql server types via `add_query` and/or `add_raw_query` and/or `add_mutation`:
|
109
|
+
|
110
|
+
```ruby
|
111
|
+
add_query <alias>: :<graphql_server_type>, params: [...], returns: [...]
|
112
|
+
|
113
|
+
add_raw_query <alias>: 'query { ... }', params: [...]
|
114
|
+
|
115
|
+
add_mutation <alias>: :<graphql_server_type>, params: [...], returns: [...]
|
116
|
+
```
|
117
|
+
* :grey_exclamation: If not needed omit `params`
|
118
|
+
|
119
|
+
See also [here](examples/departments_service_class_examples.rb) and also here for complete example usage:
|
120
|
+
|
121
|
+
```ruby
|
122
|
+
GraphqlConnector.configure do |config|
|
123
|
+
config.add_server(name: 'Foo', uri: 'http://foo.com/api/graphql', headers: {})
|
124
|
+
end
|
125
|
+
|
126
|
+
# product.rb
|
127
|
+
class Product
|
128
|
+
extend GraphqlConnector::Foo::Query
|
129
|
+
|
130
|
+
add_query all: :products,
|
131
|
+
returns: [:id, :name]
|
132
|
+
|
133
|
+
add_query by_id: :products,
|
134
|
+
params: :id,
|
135
|
+
returns: [:name, product_category: [:id, :name]]
|
136
|
+
|
137
|
+
add_query by_names: :products,
|
138
|
+
params: :names,
|
139
|
+
returns: [:id, :name, product_category: [:id, :name]]
|
140
|
+
|
141
|
+
add_query by: :products,
|
142
|
+
params: [:id, :name],
|
143
|
+
returns: [:name]
|
144
|
+
|
145
|
+
add_query by_category_id: :products,
|
146
|
+
params: :product_category,
|
147
|
+
returns: [product_category: [:id, :name]]
|
148
|
+
|
149
|
+
add_mutation create: :createProduct,
|
150
|
+
params: [:name, :catgetoryId],
|
151
|
+
returns: [:id, :name]
|
152
|
+
end
|
153
|
+
|
154
|
+
Product.all
|
155
|
+
=> [OpenStruct<id=1, name='Demo Product', ...]
|
156
|
+
|
157
|
+
Product.by_id(id: 1)
|
158
|
+
=> [OpenStruct<name='Demo Product', product_category=<ProductCategory<id=10, name='Demo Category'>>]
|
159
|
+
|
160
|
+
Product.by_names(names: ['Demo Product', 'Non Demo Product'])
|
161
|
+
=> [OpenStruct<id=1, name='Demo Product', product_category=<ProductCategory<id=10, name='Demo Category'>>, Product<id=2, name='Demo Product' ...]
|
162
|
+
|
163
|
+
Product.by(id: 1, name: 'Demo Product')
|
164
|
+
=> OpenStruct<name='Demo Product'>
|
165
|
+
|
166
|
+
Product.by_category_id(product_category: { id: 10})
|
167
|
+
=> OpenStruct<product_category=<ProductCategory<id=10, name='Demo Category'>>
|
168
|
+
|
169
|
+
Product.create(name: 'Another Product', catgetoryId: 10)
|
170
|
+
=> OpenStruct<id=10, name='Another Product'>
|
171
|
+
```
|
172
|
+
|
173
|
+
Also custom **class methods** can used to call any kind of `query` and do further selection instead:
|
174
|
+
|
175
|
+
```ruby
|
176
|
+
class Product
|
177
|
+
extend GraphqlConnector::Foo::Query
|
178
|
+
|
179
|
+
add_query all: :products, returns: [:name]
|
180
|
+
|
181
|
+
def self.by_id(id:)
|
182
|
+
all.select { |products| products.id == id }.first
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
Product.by_id(id: 1)
|
187
|
+
=> OpenStruct<id=1, name='Demo Product'>>
|
188
|
+
```
|
189
|
+
|
190
|
+
:warning: Ensure that your custom **class method** never has the **same name** as an `<alias>` of `add_query`, `add_raw_query` or `add_mutation`. Otherwise the associated grapqhl query will not be performed because of [Ruby Open Class principle](https://ruby-lang.co/ruby-open-class/)
|
191
|
+
|
192
|
+
|
193
|
+
Example for `raw_query`:
|
194
|
+
|
195
|
+
```ruby
|
196
|
+
class Product
|
197
|
+
extend GraphqlConnector::Foo::Query
|
198
|
+
|
199
|
+
add_raw_query all: ' query { products { id name } } '
|
200
|
+
add_raw_query by: ' query products($id: !ID, $name: !String) '\
|
201
|
+
'{ products(id: $id, name: $name) { id name } }',
|
202
|
+
params: [:id, :name]
|
203
|
+
|
204
|
+
end
|
205
|
+
|
206
|
+
Product.all
|
207
|
+
=> [ { id: '1', name: 'Demo Product' }, ...]
|
208
|
+
|
209
|
+
Product.by(id: '1', name: 'Demo Product')
|
210
|
+
=> { id: '1', name: 'Demo Product' }
|
211
|
+
|
212
|
+
```
|
213
|
+
|
214
|
+
:exclamation: There is no `add_raw_mutation` since `add_raw_query` does already cover such a case
|
215
|
+
|
74
216
|
## Development
|
75
217
|
|
76
218
|
After checking out the repo, run
|
@@ -87,7 +229,7 @@ You can also run `bin/console` for an interactive prompt that will allow you to
|
|
87
229
|
|
88
230
|
## Contributing
|
89
231
|
|
90
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/garllon/graphql_connector. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
232
|
+
Bug reports and pull requests are welcome on GitHub at [https://github.com/garllon/graphql_connector](https://github.com/garllon/graphql_connector). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
91
233
|
|
92
234
|
## License
|
93
235
|
|
@@ -95,4 +237,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
95
237
|
|
96
238
|
## Code of Conduct
|
97
239
|
|
98
|
-
Everyone interacting in the GraphqlConnector project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
240
|
+
Everyone interacting in the GraphqlConnector project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/Garllon/graphql_connector/blob/master/CODE_OF_CONDUCT.md).
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
4
|
+
# ! The following examples are used together with
|
5
|
+
# ! https://github.com/sushie1984/rails-graphql-server
|
6
|
+
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
7
|
+
|
8
|
+
uri = 'http://rails-graphql-server.herokuapp.com/api/graphql'
|
9
|
+
GraphqlConnector.configure do |config|
|
10
|
+
config.add_server(name: 'RailsGraphqlServer', uri: uri, headers: {})
|
11
|
+
end
|
12
|
+
|
13
|
+
# Service class for fetching department data
|
14
|
+
class Department
|
15
|
+
extend GraphqlConnector::RailsGraphqlServer::Query
|
16
|
+
|
17
|
+
add_query all: :departments, returns: [:id, :name, employees: [:yearlySalary]]
|
18
|
+
|
19
|
+
add_query by_id: :departments,
|
20
|
+
params: [:id],
|
21
|
+
returns: [:id, :name, employees: [:yearlySalary]]
|
22
|
+
|
23
|
+
add_raw_query all_raw: 'query {
|
24
|
+
departments {
|
25
|
+
id name employees { yearlySalary }
|
26
|
+
}
|
27
|
+
}'
|
28
|
+
|
29
|
+
add_raw_query by_id_raw: 'query departments($id: [ID!]) {
|
30
|
+
departments(id: $id) {
|
31
|
+
name employees { name }
|
32
|
+
}
|
33
|
+
}',
|
34
|
+
params: [:id]
|
35
|
+
|
36
|
+
# We use a nested 'input' as of convention for
|
37
|
+
# https://github.com/sushie1984/rails-graphql-server/blob/master/app/graphql/input_objects/department_attributes.rb
|
38
|
+
add_mutation create: :createDepartment,
|
39
|
+
params: :input,
|
40
|
+
returns: [department: %i[id name location]]
|
41
|
+
end
|
42
|
+
|
43
|
+
Department.all
|
44
|
+
|
45
|
+
Department.by_id(id: %w[1 2])
|
46
|
+
|
47
|
+
Department.all_raw
|
48
|
+
|
49
|
+
Department.by_id_raw(id: %w[1 2])
|
50
|
+
|
51
|
+
Department.create(input: { attributes: { name: 'One', location: 'Berlin' } })
|