graphqljs-rails 0.4.3 → 0.4.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1c7c7ff2be031ac1be05e99edddccb614832e45
4
- data.tar.gz: b818bbe12cc2454467c5436f0ba6b1e0d0de09fc
3
+ metadata.gz: ba7a6ab58b5d8372d73586d90108c809ec4bcf0a
4
+ data.tar.gz: c3988512f7d48b17a1d3b009312508ea3a32e44c
5
5
  SHA512:
6
- metadata.gz: e68a5c8ebddda33fb2743d692f23311edd2e453f07864a3bf362eb7f3da7112cd073b4c8b507b616589f1c0b62053ef9c8e6f830e16310dffe1defb36be1795f
7
- data.tar.gz: a64a413ff3ea2aef44ad23cd1e9d182297ec45b347be0f327375ebc7ae66ef18c78e324896ec4d266db2a79eba6bad7902d67c24a4c04b84d65af937d87b2fd1
6
+ metadata.gz: 4be168b5e4f2b742d262b40b8d5d24078538bc28b9829ad403aef24078e4335acbb8959ac1992de11caeb874e75acc278b1c6999afb92d1d00df5495cd5acc24
7
+ data.tar.gz: f814a6500719fee6fb77f5ef6e2f0dda3ff671b302ca48acc8b2d12d10d7c30d90684a9f037549e4d6dd4951eacdc5afdec034d325bba991dd03d9780d2f5b63
@@ -25,18 +25,10 @@
25
25
  return extended
26
26
  }
27
27
 
28
- function __xhr() {
29
- if (window.XMLHttpRequest) {
30
- return new window.XMLHttpRequest
31
- } else {
32
- try { return new ActiveXObject("MSXML2.XMLHTTP.3.0") } catch(ex) { return null }
33
- }
34
- }
35
-
36
28
  function __request(method, url, headers, data, callback) {
37
29
  var body = "query=" + escape(data.query) + "&variables=" + escape(JSON.stringify(data.variables))
38
30
  if (typeof XMLHttpRequest != 'undefined') {
39
- var xhr = __xhr()
31
+ var xhr = new XMLHttpRequest
40
32
  xhr.open(method, url, true)
41
33
  xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded')
42
34
  xhr.setRequestHeader('Accept', 'application/json')
@@ -86,7 +78,7 @@
86
78
  }
87
79
  return _lazy
88
80
  } else if (arguments[2] !== true) {
89
- throw "You cannot create GraphQLClient instance. Please call GraphQLClient as function."
81
+ throw new Error("You cannot create GraphQLClient instance. Please call GraphQLClient as function.")
90
82
  }
91
83
  if (!options)
92
84
  options = {}
@@ -132,7 +124,7 @@
132
124
  var getter = new Function("fragments", "return fragments." + path.replace(/\./g, FRAGMENT_SEPERATOR))
133
125
  var obj = getter(fragments)
134
126
  if (path != "on" && (!obj || typeof obj != "string")) {
135
- throw "Fragment " + path + " not found"
127
+ throw new Error("Fragment " + path + " not found")
136
128
  }
137
129
  return obj
138
130
  }
@@ -147,7 +139,7 @@
147
139
  if (fragment) {
148
140
  var pathRegexp = new RegExp(fragmentRegexp.source.replace(/\((.*)\)/, path))
149
141
  if (fragment.match(pathRegexp)) {
150
- throw "Recursive fragment usage detected on " + path + "."
142
+ throw new Error("Recursive fragment usage detected on " + path + ".")
151
143
  }
152
144
  collectedFragments.push(fragment)
153
145
  // Collect sub fragments
@@ -1,5 +1,5 @@
1
1
  module GraphQLJS
2
2
  module Rails
3
- VERSION = "0.4.3"
3
+ VERSION = "0.4.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphqljs-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fatih Kadir Akın