simple_graphql_client 0.1.0 → 0.2.0

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
  SHA256:
3
- metadata.gz: a96e1ad94b231b6129ecdc7bf494fd68d42ac70337dbb69669807dedf8d4d3d8
4
- data.tar.gz: 2ee556a6a36d50b2220533ab46153226dce3e4cebc2025c338dbacb1db614d03
3
+ metadata.gz: 2a733a4c42a0abd03c46fbe63cae65c00c8ebc5c3ea293e2ba97e952dd8f27c8
4
+ data.tar.gz: 2e120b0bdafa8e823f7720be8d339709fecbac979f7e52cb34b851dc4c281410
5
5
  SHA512:
6
- metadata.gz: cfa413605f565ae4118c872a3b2318a2a83f3b23990da38047f9104296c276c842f673feb4e9c6173f22543fc48448c091be4ace86b9728a416a69c4aff1849c
7
- data.tar.gz: ef3b02d3b582e5ff0ec55e7cb1e572d5de00cdd94286015ffa7e99db5c66859f86ab840e458b7e93f4bdaef017439969310990f86fccab1ec8b8b780b606f181
6
+ metadata.gz: a6455f8aec6ee8c635a615795c1f2958b7bfb4f9e48566a89398bdf0ae9a106a80dc3bbff6f98a3ee97c7335e3a0e20c1534ea61ec6b67832e6ad9906bbe0e98
7
+ data.tar.gz: 7e7ee2fb4473d9fb9e763e097bebeb7ca2a77cd28f062506bd089ca8393e2557853f7eafa4c1efb866c6a7334473f27b436e8bc88389fd71c254de03d36e8152
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_graphql_client (0.1.0)
4
+ simple_graphql_client (0.2.0)
5
5
  rest-client (~> 2.1)
6
6
 
7
7
  GEM
@@ -64,10 +64,10 @@ PLATFORMS
64
64
  x86_64-linux
65
65
 
66
66
  DEPENDENCIES
67
- simple_graphql_client!
68
67
  rake (~> 13.0)
69
68
  rspec (~> 3.0)
70
69
  rubocop (~> 0.80)
70
+ simple_graphql_client!
71
71
 
72
72
  BUNDLED WITH
73
73
  2.2.3
@@ -15,7 +15,7 @@ module SimpleGraphqlClient
15
15
  query: gql,
16
16
  variables: variables
17
17
  }.to_json, request_options)
18
- handle_response(JSON.parse(response.body))
18
+ handle_response(JSON.parse(response.body, object_class: OpenStruct))
19
19
  end
20
20
 
21
21
  private
@@ -27,9 +27,9 @@ module SimpleGraphqlClient
27
27
  end
28
28
 
29
29
  def handle_response(body)
30
- raise SimpleGraphqlClient::Errors::QueryError, body["errors"] if body.key?("errors")
30
+ raise SimpleGraphqlClient::Errors::QueryError, body.errors if body.errors
31
31
 
32
- body["data"]
32
+ body.data
33
33
  end
34
34
  end
35
35
  end
@@ -12,9 +12,7 @@ module SimpleGraphqlClient
12
12
 
13
13
  def message
14
14
  str = "#{errors.count} error(s) found in your query: "
15
- str + errors.map do |error|
16
- error["message"]
17
- end.join(', \n')
15
+ str + errors.map(&:message).join(', \n')
18
16
  end
19
17
  end
20
18
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SimpleGraphqlClient
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
Binary file
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
 
17
17
  spec.metadata["homepage_uri"] = spec.homepage
18
18
  spec.metadata["source_code_uri"] = "https://github.com/djpate/simple-graphql-client"
19
- spec.metadata["changelog_uri"] = "https://github.com/djpate/simple-graphql-client/changelog.md"
19
+ spec.metadata["changelog_uri"] = "https://github.com/djpate/simple-graphql-client/blob/main/Changelog.md"
20
20
 
21
21
  # Specify which files should be added to the gem when it is released.
22
22
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_graphql_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christophe Verbinnen
@@ -48,6 +48,7 @@ files:
48
48
  - lib/simple_graphql_client/client.rb
49
49
  - lib/simple_graphql_client/errors/query_error.rb
50
50
  - lib/simple_graphql_client/version.rb
51
+ - simple_graphql_client-0.1.0.gem
51
52
  - simple_graphql_client.gemspec
52
53
  homepage: https://github.com/djpate/simple-graphql-client
53
54
  licenses:
@@ -55,7 +56,7 @@ licenses:
55
56
  metadata:
56
57
  homepage_uri: https://github.com/djpate/simple-graphql-client
57
58
  source_code_uri: https://github.com/djpate/simple-graphql-client
58
- changelog_uri: https://github.com/djpate/simple-graphql-client/changelog.md
59
+ changelog_uri: https://github.com/djpate/simple-graphql-client/blob/main/Changelog.md
59
60
  post_install_message:
60
61
  rdoc_options: []
61
62
  require_paths: