graphqljs-rails 0.4.11 → 0.4.12
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/app/assets/javascripts/graphql.js +10 -1
- data/lib/graphqljs/rails/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: 70be6602f293c1ee44e598ede804dc546a4775cc
|
4
|
+
data.tar.gz: 7c184e5f390a2f51ff1428a25f689917f77d9dae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 555229c5622b832029a9ee9961f4a6d6ed3b1d4dddacabfabbee118f9180e318f88e56e9125b94c3f113c93303ecdc5bd27716265f80e56bcc4e2bcd65509b8f
|
7
|
+
data.tar.gz: 69d5fdd3113c3c9973c6ea66f8e59f83c9074e7d51a76277e063d5d80af7727b4449dcdba8792b1b77b345544eb625ff74c0d0df596cc7e2644b21bb25d6d371
|
@@ -167,6 +167,15 @@
|
|
167
167
|
}
|
168
168
|
|
169
169
|
GraphQLClient.prototype.processQuery = function (query, fragments) {
|
170
|
+
if (typeof query == 'object' && query.hasOwnProperty('kind') && query.hasOwnProperty('definitions')) {
|
171
|
+
// This looks like a graphql AST.
|
172
|
+
try {
|
173
|
+
var graphql = require('graphql')
|
174
|
+
query = graphql.print(query)
|
175
|
+
} catch (e) {
|
176
|
+
throw new Error("You tried to pass a graphql syntax tree but it cannot be compiled to string.")
|
177
|
+
}
|
178
|
+
}
|
170
179
|
var fragmentRegexp = GraphQLClient.FRAGMENT_PATTERN
|
171
180
|
var collectedFragments = this.collectFragments(query, fragments)
|
172
181
|
query = query.replace(fragmentRegexp, function (_, $m) {
|
@@ -226,7 +235,7 @@
|
|
226
235
|
}
|
227
236
|
|
228
237
|
GraphQLClient.prototype.buildQuery = function (query, variables) {
|
229
|
-
return this.autoDeclare(this.processQuery(query, this._fragments
|
238
|
+
return this.autoDeclare(this.processQuery(query, this._fragments), variables)
|
230
239
|
}
|
231
240
|
|
232
241
|
GraphQLClient.prototype.createSenderFunction = function (url) {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphqljs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fatih Kadir Akın
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|