graphlient 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c5a902290bf910c35ad39c06f697c00b54e0156
4
- data.tar.gz: c27b7ed166bf0acc803547aad92f5cbc35164da2
3
+ metadata.gz: 34caaff4616027770512deba3bd043d83379d84f
4
+ data.tar.gz: 95ee485aee51537d6e90e67aa4616ce1db4bcef9
5
5
  SHA512:
6
- metadata.gz: e8ca60f3ced8b55dc975bce37727abeeddbb18612c8c33596502e23b3b785613d38bae6e48a94e270d635bf89ef9b3e57e8c9b779a4cca764ef2ce5b2da708ba
7
- data.tar.gz: a9474b9a2bef82b9fa4aff02d2e314827e5dc97a8f16b7efe30f4b836c10a2eb5acb967978fed95043a27cf89c2985c7aaf2df6878e63923bcab82a9f2fbf2e3
6
+ metadata.gz: ce7dd3f6274fee8b92c674f833bde196cb5195c34e06e07911b5753aa20d41c9a16d0e041fac8b9f4ab57f3eb6b8deffe6ae6c87c5e59682c0b5e182f46412d8
7
+ data.tar.gz: 3334aeb5aa4c80d8a715b9a74fd5b7f657e5bd8403f8cc0ac927059416b913818758c0c34ba18f45656756c210a1da2520b4f301c8f7b336ba691faae971469e
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2017-10-27 10:35:56 -0400 using RuboCop version 0.47.1.
3
+ # on 2018-05-17 08:20:20 -0500 using RuboCop version 0.56.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -13,16 +13,23 @@ Lint/UnusedMethodArgument:
13
13
  Exclude:
14
14
  - 'lib/graphlient/adapters/http/http_adapter.rb'
15
15
 
16
- # Offense count: 1
16
+ # Offense count: 2
17
17
  Metrics/CyclomaticComplexity:
18
- Max: 9
18
+ Max: 8
19
19
 
20
20
  # Offense count: 1
21
21
  Metrics/PerceivedComplexity:
22
- Max: 9
22
+ Max: 8
23
+
24
+ # Offense count: 1
25
+ # Cop supports --auto-correct.
26
+ Performance/InefficientHashSearch:
27
+ Exclude:
28
+ - 'lib/graphlient/query.rb'
23
29
 
24
30
  # Offense count: 1
25
- # Configuration parameters: EnforcedStyle, SupportedStyles.
31
+ # Cop supports --auto-correct.
32
+ # Configuration parameters: AutoCorrect, EnforcedStyle.
26
33
  # SupportedStyles: nested, compact
27
34
  Style/ClassAndModuleChildren:
28
35
  Exclude:
@@ -30,7 +37,7 @@ Style/ClassAndModuleChildren:
30
37
 
31
38
  # Offense count: 2
32
39
  # Cop supports --auto-correct.
33
- # Configuration parameters: EnforcedStyle, SupportedStyles.
40
+ # Configuration parameters: EnforcedStyle.
34
41
  # SupportedStyles: line_count_dependent, lambda, literal
35
42
  Style/Lambda:
36
43
  Exclude:
@@ -38,7 +45,7 @@ Style/Lambda:
38
45
  - 'spec/support/queries/query.rb'
39
46
 
40
47
  # Offense count: 2
41
- Style/MethodMissing:
48
+ Style/MethodMissingSuper:
42
49
  Exclude:
43
50
  - 'lib/graphlient/extensions/query.rb'
44
51
  - 'lib/graphlient/query.rb'
@@ -49,7 +56,17 @@ Style/MultilineBlockChain:
49
56
  - 'spec/graphlient/client_query_spec.rb'
50
57
  - 'spec/graphlient/client_schema_spec.rb'
51
58
 
59
+ # Offense count: 2
60
+ # Cop supports --auto-correct.
61
+ # Configuration parameters: ConvertCodeThatCanStartToReturnNil, Whitelist.
62
+ # Whitelist: present?, blank?, presence, try, try!
52
63
  Style/SafeNavigation:
53
64
  Exclude:
54
- - 'lib/graphlient/client.rb'
55
65
  - 'lib/graphlient/adapters/http/http_adapter.rb'
66
+ - 'lib/graphlient/client.rb'
67
+
68
+ # Offense count: 37
69
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
70
+ # URISchemes: http, https
71
+ Metrics/LineLength:
72
+ Max: 181
@@ -3,7 +3,6 @@ language: ruby
3
3
  cache: bundler
4
4
 
5
5
  rvm:
6
- - 2.2.9
7
6
  - 2.3.6
8
7
  - 2.4.3
9
8
  - 2.5.0
@@ -11,6 +10,9 @@ rvm:
11
10
  - jruby-9.1.16.0
12
11
  - jruby-head
13
12
 
13
+ before_install:
14
+ - gem update --system
15
+
14
16
  matrix:
15
17
  include:
16
18
  - rvm: 2.3.6
@@ -1,7 +1,12 @@
1
- ### 0.3.1 (Next)
1
+ ### (Next)
2
2
 
3
- * [#43](https://github.com/ashkan18/graphlient/pull/38): Allow to load and dump schema to json - [@povilasjurcys](https://github.com/povilasjurcys).
4
3
  * Your contribution here.
4
+ * [#46](https://github.com/ashkan18/graphlient/pull/46): Fix issue with gathering error details when trying `to_s` on `GraphQLError` - [@ashkan18](https://github.com/ashkan18).
5
+ * [#45](https://github.com/ashkan18/graphlient/pull/45): Drop Support for Ruby 2.2 and Lock RuboCop - [@jonallured](https://github.com/jonallured).
6
+
7
+ ### 0.3.1 (04/17/2018)
8
+
9
+ * [#43](https://github.com/ashkan18/graphlient/pull/43): Allow to load and dump schema to json - [@povilasjurcys](https://github.com/povilasjurcys).
5
10
 
6
11
  ### 0.3.0 (02/22/2018)
7
12
 
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ gem 'rake'
7
7
  group :development do
8
8
  gem 'byebug', platform: :ruby
9
9
  gem 'danger-changelog', '~> 0.2.1'
10
- gem 'rubocop', '~> 0.48', require: false
10
+ gem 'rubocop', '0.56.0'
11
11
  end
12
12
 
13
13
  group :test do
data/README.md CHANGED
@@ -352,7 +352,7 @@ describe App do
352
352
  end
353
353
 
354
354
  it 'retrieves schema' do
355
- expect(client.schema).to be_a GraphQL::Schema
355
+ expect(client.schema).to be_a Graphlient::Schema
356
356
  end
357
357
  end
358
358
  ```
@@ -9,7 +9,7 @@ module Graphlient
9
9
 
10
10
  request['Accept'] = 'application/json'
11
11
  request['Content-Type'] = 'application/json'
12
- headers && headers.each { |name, value| request[name] = value }
12
+ headers&.each { |name, value| request[name] = value }
13
13
 
14
14
  body = {}
15
15
  body['query'] = document.to_query_string
@@ -26,7 +26,7 @@ module Graphlient
26
26
  raise Graphlient::Errors::GraphQLError, rc if rc.errors.any?
27
27
  # see https://github.com/github/graphql-client/pull/132
28
28
  # see https://github.com/exAspArk/graphql-errors/issues/2
29
- raise Graphlient::Errors::ExecutionError, rc if rc.data && rc.data.errors && rc.data.errors.any?
29
+ raise Graphlient::Errors::ExecutionError, rc if rc.data&.errors && rc.data.errors.any?
30
30
  rc
31
31
  rescue GraphQL::Client::Error => e
32
32
  raise Graphlient::Errors::ClientError.new(e.message, e)
@@ -25,9 +25,19 @@ module Graphlient
25
25
  details.map { |detail| create_detail(detail) }
26
26
  end
27
27
 
28
+ ##
29
+ # Generates human readable error explanation from a GraphQL error message
30
+ # It first tries `problem` attribute of the error response
31
+ # then checks for error root level `path` and tries to generate error from that
32
+ # and if none exist, it fallbacks to just return error message
28
33
  def create_detail(detail)
29
- message = detail['message']
30
- [message, create_problems(detail['problems']).compact.join("\n ")].join("\n ")
34
+ if detail.key?('problems')
35
+ [detail['message'], create_problems(detail['problems']).compact.join("\n ")].join("\n ")
36
+ elsif detail.key?('path')
37
+ [detail['path'].compact.join(' '), detail['message']].join(': ')
38
+ else
39
+ detail['message']
40
+ end
31
41
  end
32
42
 
33
43
  def create_problems(problems)
@@ -35,9 +45,8 @@ module Graphlient
35
45
  end
36
46
 
37
47
  def create_problem(problem)
38
- paths = problem['path'].join(', ')
39
- explanation = problem['explanation']
40
- [paths, explanation].join(': ')
48
+ paths = problem.key?('path') && !problem['path'].empty? ? "#{problem['path'].join(', ')}: " : ''
49
+ [paths, problem['explanation']].compact.join
41
50
  end
42
51
  end
43
52
  end
@@ -100,7 +100,7 @@ module Graphlient
100
100
  when Hash
101
101
  "{ #{value.map { |k, v| "#{k}: #{argument_value_string(v)}" }.join(', ')} }"
102
102
  when Symbol
103
- @variables.keys.include?(value) ? "$#{value}" : value.to_s.camelize(:lower)
103
+ @variables.key?(value) ? "$#{value}" : value.to_s.camelize(:lower)
104
104
  else
105
105
  value
106
106
  end
@@ -1,3 +1,3 @@
1
1
  module Graphlient
2
- VERSION = '0.3.1'.freeze
2
+ VERSION = '0.3.2'.freeze
3
3
  end
@@ -8,9 +8,9 @@ describe Graphlient::Client do
8
8
  let(:query) do
9
9
  client.parse do
10
10
  query do
11
- invoices(ids: [10]) do
11
+ invoice(id: 10) do
12
12
  id
13
- fee_in_cents
13
+ feeInCents
14
14
  end
15
15
  end
16
16
  end
@@ -22,18 +22,18 @@ describe Graphlient::Client do
22
22
 
23
23
  it '#execute' do
24
24
  response = client.execute(query)
25
- invoices = response.data.invoices
26
- expect(invoices.first.id).to eq 10
25
+ invoice = response.data.invoice
26
+ expect(invoice.id).to eq '10'
27
27
  end
28
28
  end
29
29
 
30
30
  context 'parameterized query' do
31
31
  let(:query) do
32
32
  client.parse do
33
- query(some_ids: [:int]) do
34
- invoices(ids: :some_ids) do
33
+ query(some_id: :int) do
34
+ invoice(id: :some_id) do
35
35
  id
36
- fee_in_cents
36
+ feeInCents
37
37
  end
38
38
  end
39
39
  end
@@ -44,52 +44,71 @@ describe Graphlient::Client do
44
44
  end
45
45
 
46
46
  it '#execute' do
47
- response = client.execute(query, some_ids: [42])
48
- invoices = response.data.invoices
49
- expect(invoices.first.id).to eq 42
50
- expect(invoices.first.fee_in_cents).to eq 20_000
47
+ response = client.execute(query, some_id: 42)
48
+ invoice = response.data.invoice
49
+ expect(invoice.id).to eq '42'
50
+ expect(invoice.fee_in_cents).to eq 20_000
51
51
  end
52
52
 
53
53
  it '#execute without variables' do
54
54
  response = client.execute(query)
55
- invoices = response.data.invoices
56
- expect(invoices).to eq([])
55
+ invoice = response.data.invoice
56
+ expect(invoice).to be_nil
57
57
  end
58
58
  end
59
59
 
60
60
  context 'parameterized GRAPHQL query' do
61
61
  let(:query) do
62
62
  <<-GRAPHQL
63
- query($ids: [Int]) {
64
- invoices(ids: $ids) {
63
+ query($id: Int) {
64
+ invoice(id: $id) {
65
65
  id
66
- fee_in_cents
66
+ feeInCents
67
+ }
68
+ }
69
+ GRAPHQL
70
+ end
71
+
72
+ let(:not_null_query) do
73
+ <<-GRAPHQL
74
+ query($id: Int) {
75
+ notNullInvoice(id: $id) {
76
+ id
77
+ feeInCents
67
78
  }
68
79
  }
69
80
  GRAPHQL
70
81
  end
71
82
 
72
83
  it '#execute' do
73
- response = client.execute(query, ids: [42])
74
- invoices = response.data.invoices
75
- expect(invoices.first.id).to eq 42
76
- expect(invoices.first.fee_in_cents).to eq 20_000
84
+ response = client.execute(query, id: 42)
85
+ invoice = response.data.invoice
86
+ expect(invoice.id).to eq '42'
87
+ expect(invoice.fee_in_cents).to eq 20_000
77
88
  end
78
89
 
79
90
  it 'fails when wrong input type' do
80
91
  expect do
81
- client.execute(query, ids: ['42'])
92
+ client.execute(query, id: '42')
82
93
  end.to raise_error Graphlient::Errors::GraphQLError do |e|
83
- expect(e.to_s).to eq "Variable ids of type [Int] was provided invalid value\n 0: Could not coerce value \"42\" to Int"
94
+ expect(e.to_s).to eq "Variable id of type Int was provided invalid value\n Could not coerce value \"42\" to Int"
84
95
  end
85
96
  end
86
97
 
87
98
  it 'fails on an execution error' do
88
99
  expect do
89
100
  allow(OpenStruct).to receive(:new).and_raise StandardError, 'Unexpected error.'
90
- client.execute(query, ids: [42])
101
+ client.execute(query, id: 42)
91
102
  end.to raise_error Graphlient::Errors::ExecutionError do |e|
92
- expect(e.to_s).to eq 'invoices: Unexpected error.'
103
+ expect(e.to_s).to eq 'invoice: Unexpected error.'
104
+ end
105
+ end
106
+
107
+ it 'fails with proper error message' do
108
+ expect do
109
+ client.execute(not_null_query, id: 42)
110
+ end.to raise_error Graphlient::Errors::GraphQLError do |e|
111
+ expect(e.to_s).to eq 'Cannot return null for non-nullable field Query.notNullInvoice'
93
112
  end
94
113
  end
95
114
  end
@@ -101,59 +120,62 @@ describe Graphlient::Client do
101
120
  expect do
102
121
  client.query do
103
122
  query do
104
- invoice(id: 10) do
123
+ invoices(id: 10) do
105
124
  id
106
- fee_in_cents
125
+ feeInCents
107
126
  end
108
127
  end
109
128
  end
110
129
  end.to raise_error Graphlient::Errors::ClientError do |e|
111
- expect(e.to_s).to eq "Field 'invoice' doesn't exist on type 'Query'"
130
+ expect(e.to_s).to eq "Field 'invoices' doesn't exist on type 'Query'"
112
131
  end
113
132
  end
114
133
 
115
134
  it 'returns a response from a query' do
116
135
  response = client.query do
117
136
  query do
118
- invoices(ids: [10]) do
137
+ invoice(id: 10) do
119
138
  id
120
- fee_in_cents
139
+ feeInCents
121
140
  end
122
141
  end
123
142
  end
124
143
 
125
- invoices = response.data.invoices
126
- expect(invoices.first.id).to eq 10
127
- expect(invoices.first.fee_in_cents).to eq 20_000
144
+ invoice = response.data.invoice
145
+ expect(invoice.id).to eq '10'
146
+ expect(invoice.fee_in_cents).to eq 20_000
128
147
  end
129
148
 
130
149
  it 'returns a response from a GRAPHQL query' do
131
150
  response = client.query <<-GRAPHQL
132
151
  query {
133
- invoices(ids: [10]) {
152
+ invoice(id: 10) {
134
153
  id
135
- fee_in_cents
154
+ feeInCents
136
155
  }
137
156
  }
138
157
  GRAPHQL
139
158
 
140
- invoices = response.data.invoices
141
- expect(invoices.first.id).to eq 10
142
- expect(invoices.first.fee_in_cents).to eq 20_000
159
+ invoice = response.data.invoice
160
+ expect(invoice.id).to eq '10'
161
+ expect(invoice.fee_in_cents).to eq 20_000
143
162
  end
144
163
 
145
164
  it 'returns a response from a mutation' do
146
165
  response = client.query do
147
166
  mutation do
148
- createInvoice(input: { fee_in_cents: 12_345 }) do
149
- id
150
- fee_in_cents
167
+ createInvoice(input: { feeInCents: 12_345 }) do
168
+ invoice do
169
+ id
170
+ feeInCents
171
+ end
172
+ errors
151
173
  end
152
174
  end
153
175
  end
154
176
 
155
- invoice = response.data.create_invoice.first
156
- expect(invoice.id).to eq 1231
177
+ invoice = response.data.create_invoice.invoice
178
+ expect(invoice.id).to eq '1231'
157
179
  expect(invoice.fee_in_cents).to eq 12_345
158
180
  end
159
181
  end
@@ -162,59 +184,67 @@ describe Graphlient::Client do
162
184
  it 'fails when missing input' do
163
185
  expect do
164
186
  client.query do
165
- mutation(input: :createInvoiceInput!) do
187
+ mutation(input: :CreateInvoiceInput!) do
166
188
  createInvoice(input: :input) do
167
- id
168
- fee_in_cents
189
+ invoice do
190
+ id
191
+ feeInCents
192
+ end
193
+ errors
169
194
  end
170
195
  end
171
196
  end
172
197
  end.to raise_error Graphlient::Errors::GraphQLError,
173
- "Variable input of type createInvoiceInput! was provided invalid value\n : Expected value to not be null"
198
+ "Variable input of type CreateInvoiceInput! was provided invalid value\n Expected value to not be null"
174
199
  end
175
200
 
176
201
  it 'returns a response from a query' do
177
- response = client.query(ids: [42]) do
178
- query(ids: [:int]) do
179
- invoices(ids: :ids) do
202
+ response = client.query(id: 42) do
203
+ query(id: :int) do
204
+ invoice(id: :id) do
180
205
  id
181
- fee_in_cents
206
+ feeInCents
182
207
  end
183
208
  end
184
209
  end
185
210
 
186
- invoices = response.data.invoices
187
- expect(invoices.first.id).to eq 42
188
- expect(invoices.first.fee_in_cents).to eq 20_000
211
+ invoice = response.data.invoice
212
+ expect(invoice.id).to eq '42'
213
+ expect(invoice.fee_in_cents).to eq 20_000
189
214
  end
190
215
 
191
216
  it 'executes the mutation' do
192
- response = client.query(input: { fee_in_cents: 12_345 }) do
193
- mutation(input: :createInvoiceInput!) do
217
+ response = client.query(input: { feeInCents: 12_345 }) do
218
+ mutation(input: :CreateInvoiceInput!) do
194
219
  createInvoice(input: :input) do
195
- id
196
- fee_in_cents
220
+ invoice do
221
+ id
222
+ feeInCents
223
+ end
224
+ errors
197
225
  end
198
226
  end
199
227
  end
200
-
201
- invoice = response.data.create_invoice.first
202
- expect(invoice.id).to eq 1231
228
+ invoice = response.data.create_invoice.invoice
229
+ expect(invoice.id).to eq '1231'
203
230
  expect(invoice.fee_in_cents).to eq 12_345
204
231
  end
205
232
 
206
233
  it 'fails when mutation missing a field' do
207
234
  expect do
208
235
  client.query(input: {}) do
209
- mutation(input: :createInvoiceInput!) do
236
+ mutation(input: :CreateInvoiceInput!) do
210
237
  createInvoice(input: :input) do
211
- id
212
- fee_in_cents
238
+ invoice do
239
+ id
240
+ feeInCents
241
+ end
242
+ errors
213
243
  end
214
244
  end
215
245
  end
216
246
  end.to raise_error Graphlient::Errors::GraphQLError,
217
- "Variable input of type createInvoiceInput! was provided invalid value\n fee_in_cents: Expected value to not be null"
247
+ "Variable input of type CreateInvoiceInput! was provided invalid value\n feeInCents: Expected value to not be null"
218
248
  end
219
249
  end
220
250
  end
@@ -16,10 +16,10 @@ describe Graphlient::Client do
16
16
  end
17
17
 
18
18
  Query = Client.parse do
19
- query(some_ids: [:int]) do
20
- invoices(ids: :some_ids) do
19
+ query(some_id: :int) do
20
+ invoice(id: :some_id) do
21
21
  id
22
- fee_in_cents
22
+ feeInCents
23
23
  end
24
24
  end
25
25
  end
@@ -30,10 +30,10 @@ describe Graphlient::Client do
30
30
  end
31
31
 
32
32
  it '#execute' do
33
- response = Graphlient::Client::Spec::Client.execute(Graphlient::Client::Spec::Query, some_ids: [42])
34
- invoices = response.data.invoices
35
- expect(invoices.first.id).to eq 42
36
- expect(invoices.first.fee_in_cents).to eq 20_000
33
+ response = Graphlient::Client::Spec::Client.execute(Graphlient::Client::Spec::Query, some_id: 42)
34
+ invoice = response.data.invoice
35
+ expect(invoice.id).to eq '42'
36
+ expect(invoice.fee_in_cents).to eq 20_000
37
37
  end
38
38
  end
39
39
  end
@@ -1,13 +1,13 @@
1
1
  require_relative 'types/invoice_type'
2
2
 
3
3
  require_relative 'queries/query'
4
- require_relative 'mutations/mutation'
4
+ require_relative 'types/mutation_type.rb'
5
5
 
6
6
  require 'graphql/errors'
7
7
 
8
- DummySchema = GraphQL::Schema.define do
9
- query Query
10
- mutation Mutation
8
+ class DummySchema < GraphQL::Schema
9
+ query(Query)
10
+ mutation(MutationType)
11
11
  end
12
12
 
13
13
  GraphQL::Errors.configure(DummySchema) do
@@ -0,0 +1,17 @@
1
+ class CreateInvoice < GraphQL::Schema::RelayClassicMutation
2
+ null true
3
+
4
+ argument :fee_in_cents, Integer, required: true
5
+
6
+ field :invoice, InvoiceType, null: true
7
+ field :errors, [String], null: true
8
+
9
+ def resolve(fee_in_cents:)
10
+ {
11
+ invoice: OpenStruct.new(
12
+ id: 1231,
13
+ fee_in_cents: fee_in_cents
14
+ )
15
+ }
16
+ end
17
+ end
@@ -1,16 +1,24 @@
1
- Query = GraphQL::ObjectType.define do
2
- name 'Query'
1
+ require_relative '../types/invoice_type'
2
+ class Query < GraphQL::Schema::Object
3
+ field :invoice, InvoiceType, null: true do
4
+ description 'Find invoice'
5
+ argument :id, Integer, required: false
6
+ end
7
+
8
+ field :not_null_invoice, InvoiceType, null: false do
9
+ description 'Find invoice'
10
+ argument :id, Integer, required: false
11
+ end
12
+
13
+ def invoice(id: nil)
14
+ return nil if id.nil?
15
+ OpenStruct.new(
16
+ id: id,
17
+ fee_in_cents: 20_000
18
+ )
19
+ end
3
20
 
4
- field :invoices, types[InvoiceType] do
5
- argument :ids, types[types.Int]
6
- description 'Find Invoices'
7
- resolve ->(_obj, args, _ctx) {
8
- (args[:ids] || []).map do |id|
9
- OpenStruct.new(
10
- id: id,
11
- fee_in_cents: 20_000
12
- )
13
- end
14
- }
21
+ def not_null_invoice(*)
22
+ nil
15
23
  end
16
24
  end
@@ -1,6 +1,7 @@
1
- InvoiceType = GraphQL::ObjectType.define do
2
- name 'Invoice'
1
+ class InvoiceType < GraphQL::Schema::Object
3
2
  description 'An Invoice'
4
- field :id, !types.Int
5
- field :fee_in_cents, types.Int
3
+ graphql_name 'Invoice'
4
+
5
+ field :id, ID, null: false
6
+ field :fee_in_cents, Integer, null: true
6
7
  end
@@ -0,0 +1,5 @@
1
+ require_relative '../mutations/create_invoice'
2
+
3
+ class MutationType < GraphQL::Schema::Object
4
+ field :createInvoice, mutation: CreateInvoice
5
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphlient
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ashkan Nasseri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-17 00:00:00.000000000 Z
11
+ date: 2018-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -103,10 +103,10 @@ files:
103
103
  - spec/support/context/dummy_client.rb
104
104
  - spec/support/dummy_app.rb
105
105
  - spec/support/dummy_schema.rb
106
- - spec/support/mutations/create_invoice_mutation.rb
107
- - spec/support/mutations/mutation.rb
106
+ - spec/support/mutations/create_invoice.rb
108
107
  - spec/support/queries/query.rb
109
108
  - spec/support/types/invoice_type.rb
109
+ - spec/support/types/mutation_type.rb
110
110
  homepage: http://github.com/ashkan18/graphlient
111
111
  licenses:
112
112
  - MIT
@@ -1,16 +0,0 @@
1
- CreateInvoiceMutation = GraphQL::Relay::Mutation.define do
2
- name 'createInvoice'
3
-
4
- input_field :fee_in_cents, !types.Int
5
-
6
- return_type types[InvoiceType]
7
-
8
- resolve ->(_object, inputs, _ctx) {
9
- [
10
- OpenStruct.new(
11
- id: 1231,
12
- fee_in_cents: inputs[:fee_in_cents]
13
- )
14
- ]
15
- }
16
- end
@@ -1,7 +0,0 @@
1
- require_relative './create_invoice_mutation'
2
-
3
- Mutation = GraphQL::ObjectType.define do
4
- name 'Mutation'
5
-
6
- field :createInvoice, field: CreateInvoiceMutation.field
7
- end