graphql-client 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/graphql/client.rb +8 -1
  3. metadata +2 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 94402332ad2601ad1ce9b92053ab77537d98a252
4
- data.tar.gz: 0bf48ac46855de0b767809bb76979f04f1ffaad8
3
+ metadata.gz: 6e4479e6ded8ce37427e5860e1933f5a300c1b50
4
+ data.tar.gz: 003125bef74a999629acb8ed10311cb209b2836a
5
5
  SHA512:
6
- metadata.gz: 1af4235ed60323283e74f9491029f48e93933a63e864249bef829e1b3f8d0727537105f4a55a2b4783c6bfea01b3a18de28d76355d2d97d2b6e254448714ecd7
7
- data.tar.gz: 4cbd9d20bf35164d6979a4137bd7b54a58d175132c9536465c57a34c64ed1141bc80602f1aad5f647bd2bd06119c80ae6803253eb523a1d448fa5e3eb71fa6e5
6
+ metadata.gz: 4eba62b6ade25e1767138e410be130a7caf818464507aecec649903f0a896e69f7442a0f908fbc09382743a4292342abefa5562b58b4973924e85429e46db696
7
+ data.tar.gz: 376afde0857506206c374cc9980d4577d99d83be32366939135da786c8152e4177dc75414727f77ab2ddc10300281316fa7f4522180681b9d91b681e22259646
@@ -24,6 +24,12 @@ module GraphQL
24
24
 
25
25
  attr_accessor :document_tracking_enabled
26
26
 
27
+ # Deprecated: Allow dynamically generated queries to be passed to
28
+ # Client#query.
29
+ #
30
+ # This ability will eventually be removed in future versions.
31
+ attr_accessor :allow_dynamic_queries
32
+
27
33
  def self.load_schema(schema)
28
34
  case schema
29
35
  when GraphQL::Schema
@@ -69,6 +75,7 @@ module GraphQL
69
75
  @execute = execute
70
76
  @document = GraphQL::Language::Nodes::Document.new(definitions: [])
71
77
  @document_tracking_enabled = false
78
+ @allow_dynamic_queries = false
72
79
  end
73
80
 
74
81
  # Definitions are constructed by Client.parse and wrap a parsed AST of the
@@ -252,7 +259,7 @@ module GraphQL
252
259
  raise TypeError, "expected definition to be a #{OperationDefinition.name} but was #{document.class.name}"
253
260
  end
254
261
 
255
- unless definition.name
262
+ if allow_dynamic_queries == false && definition.name.nil?
256
263
  raise DynamicQueryError, "expected definition to be assigned to a static constant https://git.io/vXXSE"
257
264
  end
258
265
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-15 00:00:00.000000000 Z
11
+ date: 2016-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -154,4 +154,3 @@ signing_key:
154
154
  specification_version: 4
155
155
  summary: GraphQL Client
156
156
  test_files: []
157
- has_rdoc: