graphlient 0.8.0 → 0.9.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 +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +38 -38
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -20
- data/.github/workflows/ci.yml +33 -30
- data/.github/workflows/danger-comment.yml +10 -0
- data/.github/workflows/danger.yml +13 -22
- data/.github/workflows/rubocop.yml +19 -19
- data/.gitignore +59 -52
- data/.rspec +1 -1
- data/.rubocop.yml +26 -28
- data/.rubocop_todo.yml +72 -48
- data/CHANGELOG.md +128 -113
- data/CONTRIBUTING.md +125 -125
- data/Dangerfile +24 -24
- data/Gemfile +35 -27
- data/LICENSE +21 -21
- data/README.md +800 -533
- data/RELEASING.md +63 -63
- data/Rakefile +15 -15
- data/UPGRADING.md +23 -23
- data/graphlient.gemspec +19 -19
- data/lib/graphlient/adapters/http/adapter.rb +41 -41
- data/lib/graphlient/adapters/http/faraday_adapter.rb +79 -79
- data/lib/graphlient/adapters/http/http_adapter.rb +40 -39
- data/lib/graphlient/adapters/http.rb +3 -3
- data/lib/graphlient/adapters.rb +1 -1
- data/lib/graphlient/client.rb +98 -80
- data/lib/graphlient/errors/client_error.rb +6 -6
- data/lib/graphlient/errors/connection_failed_error.rb +6 -6
- data/lib/graphlient/errors/error.rb +13 -12
- data/lib/graphlient/errors/execution_error.rb +29 -29
- data/lib/graphlient/errors/faraday_server_error.rb +12 -12
- data/lib/graphlient/errors/graphql_error.rb +53 -52
- data/lib/graphlient/errors/http_options_error.rb +6 -6
- data/lib/graphlient/errors/http_server_error.rb +13 -13
- data/lib/graphlient/errors/server_error.rb +7 -7
- data/lib/graphlient/errors/timeout_error.rb +6 -6
- data/lib/graphlient/errors.rb +10 -10
- data/lib/graphlient/extensions/query.rb +15 -15
- data/lib/graphlient/extensions.rb +1 -1
- data/lib/graphlient/query/directive.rb +47 -0
- data/lib/graphlient/query/serializer/arguments.rb +67 -0
- data/lib/graphlient/query/serializer/directives.rb +17 -0
- data/lib/graphlient/query/serializer/evaluator.rb +15 -0
- data/lib/graphlient/query/serializer/fragments.rb +28 -0
- data/lib/graphlient/query/serializer/scalars.rb +63 -0
- data/lib/graphlient/query/serializer.rb +153 -0
- data/lib/graphlient/query.rb +29 -128
- data/lib/graphlient/schema.rb +27 -26
- data/lib/graphlient/version.rb +3 -3
- data/lib/graphlient.rb +8 -8
- data/spec/graphlient/adapters/http/faraday_adapter_spec.rb +172 -167
- data/spec/graphlient/adapters/http/http_adapter_spec.rb +60 -60
- data/spec/graphlient/client_dsl_spec.rb +153 -0
- data/spec/graphlient/client_query_spec.rb +369 -346
- data/spec/graphlient/client_schema_spec.rb +75 -75
- data/spec/graphlient/extensions/query_spec.rb +16 -16
- data/spec/graphlient/github_query_spec.rb +32 -32
- data/spec/graphlient/query_dsl_spec.rb +231 -0
- data/spec/graphlient/query_spec.rb +105 -105
- data/spec/graphlient/schema_spec.rb +56 -56
- data/spec/graphlient/static_client_query_spec.rb +75 -68
- data/spec/graphlient/webmock_client_query_spec.rb +41 -41
- data/spec/spec_helper.rb +26 -14
- data/spec/support/context/dummy_client.rb +33 -26
- data/spec/support/context/github_client.rb +18 -18
- data/spec/support/dummy_app.rb +21 -19
- data/spec/support/dummy_schema.rb +17 -17
- data/spec/support/fixtures/github/schema.yml +14282 -14282
- data/spec/support/fixtures/github/user.yml +76 -76
- data/spec/support/fixtures/github/viewer.yml +76 -76
- data/spec/support/fixtures/invoice_api.json +1288 -1288
- data/spec/support/mutations/create_invoice.rb +18 -18
- data/spec/support/queries/query.rb +48 -47
- data/spec/support/schema/github.json +44479 -44479
- data/spec/support/types/invoice_type.rb +13 -13
- data/spec/support/types/mutation_type.rb +5 -5
- data/spec/support/vcr.rb +9 -9
- metadata +13 -8
- data/Gemfile.danger +0 -5
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
class InvoiceType < GraphQL::Schema::Object
|
|
2
|
-
description 'An Invoice'
|
|
3
|
-
graphql_name 'Invoice'
|
|
4
|
-
|
|
5
|
-
field :id, ID, null: false
|
|
6
|
-
field :fee_in_cents, Integer, null: true
|
|
7
|
-
field :created_at, String, null: true, extras: [:execution_errors]
|
|
8
|
-
|
|
9
|
-
def created_at(execution_errors:)
|
|
10
|
-
execution_errors.add(GraphQL::ExecutionError.new('This is a partial error'))
|
|
11
|
-
Time.now.iso8601
|
|
12
|
-
end
|
|
13
|
-
end
|
|
1
|
+
class InvoiceType < GraphQL::Schema::Object
|
|
2
|
+
description 'An Invoice'
|
|
3
|
+
graphql_name 'Invoice'
|
|
4
|
+
|
|
5
|
+
field :id, ID, null: false
|
|
6
|
+
field :fee_in_cents, Integer, null: true
|
|
7
|
+
field :created_at, String, null: true, extras: [:execution_errors]
|
|
8
|
+
|
|
9
|
+
def created_at(execution_errors:)
|
|
10
|
+
execution_errors.add(GraphQL::ExecutionError.new('This is a partial error'))
|
|
11
|
+
Time.now.iso8601
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
require_relative '../mutations/create_invoice'
|
|
2
|
-
|
|
3
|
-
class MutationType < GraphQL::Schema::Object
|
|
4
|
-
field :createInvoice, mutation: CreateInvoice
|
|
5
|
-
end
|
|
1
|
+
require_relative '../mutations/create_invoice'
|
|
2
|
+
|
|
3
|
+
class MutationType < GraphQL::Schema::Object
|
|
4
|
+
field :createInvoice, mutation: CreateInvoice
|
|
5
|
+
end
|
data/spec/support/vcr.rb
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
require 'vcr'
|
|
2
|
-
require 'webmock/rspec'
|
|
3
|
-
|
|
4
|
-
VCR.configure do |config|
|
|
5
|
-
config.cassette_library_dir = 'spec/support/fixtures'
|
|
6
|
-
config.hook_into :webmock
|
|
7
|
-
config.default_cassette_options = { record: :new_episodes }
|
|
8
|
-
config.configure_rspec_metadata!
|
|
9
|
-
end
|
|
1
|
+
require 'vcr'
|
|
2
|
+
require 'webmock/rspec'
|
|
3
|
+
|
|
4
|
+
VCR.configure do |config|
|
|
5
|
+
config.cassette_library_dir = 'spec/support/fixtures'
|
|
6
|
+
config.hook_into :webmock
|
|
7
|
+
config.default_cassette_options = { record: :new_episodes }
|
|
8
|
+
config.configure_rspec_metadata!
|
|
9
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: graphlient
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ashkan Nasseri
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: faraday
|
|
@@ -38,7 +37,6 @@ dependencies:
|
|
|
38
37
|
- - ">="
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
39
|
version: '0'
|
|
41
|
-
description:
|
|
42
40
|
email: ashkan.nasseri@gmail.com
|
|
43
41
|
executables: []
|
|
44
42
|
extensions: []
|
|
@@ -47,6 +45,7 @@ files:
|
|
|
47
45
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
|
48
46
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
|
49
47
|
- ".github/workflows/ci.yml"
|
|
48
|
+
- ".github/workflows/danger-comment.yml"
|
|
50
49
|
- ".github/workflows/danger.yml"
|
|
51
50
|
- ".github/workflows/rubocop.yml"
|
|
52
51
|
- ".gitignore"
|
|
@@ -57,7 +56,6 @@ files:
|
|
|
57
56
|
- CONTRIBUTING.md
|
|
58
57
|
- Dangerfile
|
|
59
58
|
- Gemfile
|
|
60
|
-
- Gemfile.danger
|
|
61
59
|
- LICENSE
|
|
62
60
|
- README.md
|
|
63
61
|
- RELEASING.md
|
|
@@ -85,14 +83,23 @@ files:
|
|
|
85
83
|
- lib/graphlient/extensions.rb
|
|
86
84
|
- lib/graphlient/extensions/query.rb
|
|
87
85
|
- lib/graphlient/query.rb
|
|
86
|
+
- lib/graphlient/query/directive.rb
|
|
87
|
+
- lib/graphlient/query/serializer.rb
|
|
88
|
+
- lib/graphlient/query/serializer/arguments.rb
|
|
89
|
+
- lib/graphlient/query/serializer/directives.rb
|
|
90
|
+
- lib/graphlient/query/serializer/evaluator.rb
|
|
91
|
+
- lib/graphlient/query/serializer/fragments.rb
|
|
92
|
+
- lib/graphlient/query/serializer/scalars.rb
|
|
88
93
|
- lib/graphlient/schema.rb
|
|
89
94
|
- lib/graphlient/version.rb
|
|
90
95
|
- spec/graphlient/adapters/http/faraday_adapter_spec.rb
|
|
91
96
|
- spec/graphlient/adapters/http/http_adapter_spec.rb
|
|
97
|
+
- spec/graphlient/client_dsl_spec.rb
|
|
92
98
|
- spec/graphlient/client_query_spec.rb
|
|
93
99
|
- spec/graphlient/client_schema_spec.rb
|
|
94
100
|
- spec/graphlient/extensions/query_spec.rb
|
|
95
101
|
- spec/graphlient/github_query_spec.rb
|
|
102
|
+
- spec/graphlient/query_dsl_spec.rb
|
|
96
103
|
- spec/graphlient/query_spec.rb
|
|
97
104
|
- spec/graphlient/schema_spec.rb
|
|
98
105
|
- spec/graphlient/static_client_query_spec.rb
|
|
@@ -116,7 +123,6 @@ homepage: http://github.com/ashkan18/graphlient
|
|
|
116
123
|
licenses:
|
|
117
124
|
- MIT
|
|
118
125
|
metadata: {}
|
|
119
|
-
post_install_message:
|
|
120
126
|
rdoc_options: []
|
|
121
127
|
require_paths:
|
|
122
128
|
- lib
|
|
@@ -131,8 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
131
137
|
- !ruby/object:Gem::Version
|
|
132
138
|
version: 1.3.6
|
|
133
139
|
requirements: []
|
|
134
|
-
rubygems_version:
|
|
135
|
-
signing_key:
|
|
140
|
+
rubygems_version: 4.0.8
|
|
136
141
|
specification_version: 4
|
|
137
142
|
summary: A friendlier Ruby client for consuming GraphQL-based APIs.
|
|
138
143
|
test_files: []
|