Skip to content

Commit

Permalink
Add support for Ruby 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
yuki24 committed Feb 22, 2018
1 parent afbe7fe commit 74a734f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ Style/MultilineBlockChain:
Exclude:
- 'spec/graphlient/client_query_spec.rb'
- 'spec/graphlient/client_schema_spec.rb'

Style/SafeNavigation:
Exclude:
- 'lib/graphlient/client.rb'
- 'lib/graphlient/adapters/http/http_adapter.rb'
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ language: ruby
cache: bundler

rvm:
- 2.2.9
- 2.3.6
- 2.4.3
- 2.5.0
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* Your contribution here.
* [#38](https://github.com/ashkan18/graphlient/pull/38): Add support for Ruby 2.5 - [@yuki24](https://github.com/yuki24).
* [#39](https://github.com/ashkan18/graphlient/pull/39): Add support for Ruby 2.2 - [@yuki24](https://github.com/yuki24).

### 0.2.0 (11/09/2017)

Expand Down
2 changes: 1 addition & 1 deletion lib/graphlient/adapters/http/http_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def execute(document:, operation_name: nil, variables: {}, context: {})

request['Accept'] = 'application/json'
request['Content-Type'] = 'application/json'
headers&.each { |name, value| request[name] = value }
headers && headers.each { |name, value| request[name] = value }

body = {}
body['query'] = document.to_query_string
Expand Down
2 changes: 1 addition & 1 deletion lib/graphlient/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def execute(query, variables = nil)
raise Graphlient::Errors::GraphQLError, rc if rc.errors.any?
# see https://github.com/github/graphql-client/pull/132
# see https://github.com/exAspArk/graphql-errors/issues/2
raise Graphlient::Errors::ExecutionError, rc if rc.data&.errors && rc.data.errors.any?
raise Graphlient::Errors::ExecutionError, rc if rc.data && rc.data.errors && rc.data.errors.any?
rc
rescue GraphQL::Client::Error => e
raise Graphlient::Errors::ClientError.new(e.message, e)
Expand Down
2 changes: 1 addition & 1 deletion spec/graphlient/client_query_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
end

it 'returns a response from a GRAPHQL query' do
response = client.query <<~GRAPHQL
response = client.query <<-GRAPHQL
query {
invoices(ids: [10]) {
id
Expand Down

0 comments on commit 74a734f

Please sign in to comment.