graphql-sources 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -2
- data/README.md +26 -0
- data/lib/graphql/sources/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e7c380fca740b89a1c8797745da617dd1d0b5eae2de11ca99cb2101b0b666e3
|
4
|
+
data.tar.gz: ed39e7db2d5c1ae8cd4a3e723a8277e032f2994bc8c5616f765f8ab04da22034
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52d2c0a9b72c0a7cd283ac60854b6827f187bf2e581ff67b1c0ae4f5cf4695721bbd8d704f84f5e773ddcfc1f63a4cb9d68b27356c1e322e4b46e7c18d3dba57
|
7
|
+
data.tar.gz: 6e4c3cdcd606af9d5bf43c99759459a80fe9812d7e16fb21340a66097fea9b7effc8b575111287ef6dac6ce3039e7199dceb84c34eef0818508337e80c79f8f9
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -21,6 +21,32 @@ end
|
|
21
21
|
|
22
22
|
## Usage
|
23
23
|
|
24
|
+
### Loading `belongs_to` Associations
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
class Purchase < ActiveRecord::Base
|
28
|
+
belongs_to :visitor
|
29
|
+
end
|
30
|
+
```
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
class Customer < ActiveRecord::Base
|
34
|
+
has_many :purchases
|
35
|
+
end
|
36
|
+
```
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
class PurchaseType < GraphQL::Schema::Object
|
40
|
+
field :customer, [CustomerTYpe], null: false
|
41
|
+
|
42
|
+
def customer
|
43
|
+
dataloader
|
44
|
+
.with(GraphQL::Sources::ActiveRecordObject, ::Profile, key: :id)
|
45
|
+
.load(object.customer_id)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
```
|
49
|
+
|
24
50
|
### Loading `has_one` Associations
|
25
51
|
|
26
52
|
```ruby
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-sources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Sylvestre
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop-factory_bot
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: rubocop-rails
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -220,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
234
|
- !ruby/object:Gem::Version
|
221
235
|
version: '0'
|
222
236
|
requirements: []
|
223
|
-
rubygems_version: 3.
|
237
|
+
rubygems_version: 3.4.10
|
224
238
|
signing_key:
|
225
239
|
specification_version: 4
|
226
240
|
summary: A set of common GraphQL DataLoader sources.
|