graphql-remote_loader 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/graphql/remote_loader/loader.rb +16 -0
- data/lib/graphql/remote_loader/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08255df0d13cc9804c77ad8573250fcf28a324ba'
|
4
|
+
data.tar.gz: b16f301f8bb77f5813ef6b96093d61cc583e9664
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95baeb95ffc196efa52c8b47cadc8d0f81740719b4d51423ed9fc0ebf1d5afc4149309e01d3e66667baf854634116df6a19c24a626d781e3930cb15d032d7fce
|
7
|
+
data.tar.gz: 161a3463f3b6337bf4ff437d60ef7ed8c022f0701c912351cd8c7f36fc653ec87bb2fc193bb631c198339e7a1759125af89056cd42c0e4329cbb3bf3648896df
|
data/Gemfile.lock
CHANGED
@@ -34,6 +34,22 @@ module GraphQL
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
# Shorthand helper method for #load calls selecting fields off of a `Node` type
|
38
|
+
# E.g. `load_on_relay_node("nodeid", "Type", "friends(first: 5) { totalCount }")`
|
39
|
+
# is identical to
|
40
|
+
# load("node(id: "nodeid") { ... on Type { friends(first: 5) { totalCount } } }")
|
41
|
+
def self.load_on_relay_node(node_id, type, selections, context: {})
|
42
|
+
query = <<-GRAPHQL
|
43
|
+
node(id: \"#{node_id}\") {
|
44
|
+
... on #{type} {
|
45
|
+
#{selections}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
GRAPHQL
|
49
|
+
|
50
|
+
load(query, context: context)
|
51
|
+
end
|
52
|
+
|
37
53
|
def self.reset_index
|
38
54
|
@index = nil
|
39
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-remote_loader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathaniel Woodthorpe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|