graphql-anycable 1.1.5 → 1.1.7
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/workflows/{build-release.yml → release.yml} +8 -4
- data/.github/workflows/test.yml +15 -3
- data/CHANGELOG.md +19 -0
- data/Gemfile +1 -4
- data/README.md +8 -0
- data/graphql-anycable.gemspec +1 -2
- data/lib/graphql/anycable/version.rb +1 -1
- data/lib/graphql/subscriptions/anycable_subscriptions.rb +3 -3
- metadata +7 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d792c5cf2b52398bfe6c09e768a1c3af484209aca0bbfa810eccb25480d791d2
|
4
|
+
data.tar.gz: 29eb4a0c90b0cef15040ce6c67493e832c7efe191ee90f98e1e1de4eb2c89eb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 276d5e8243fd288480ec7420eb7151e4dcb6802df9255fb2bb581d45f6f9b5d6eb582cc789d0bde4f1541bdbf17b5bab6e5c9244adb264ce24c0bafce4a57266
|
7
|
+
data.tar.gz: a7237e211c05268f1a74da0a32946b97f1f737046c1c7920b5b786f5755026f8c1529c41a3783e3ec8d41a42d37d5b52ea8672523c095bc9e42138c04f309ab3
|
@@ -8,13 +8,17 @@ on:
|
|
8
8
|
jobs:
|
9
9
|
release:
|
10
10
|
runs-on: ubuntu-latest
|
11
|
+
permissions:
|
12
|
+
contents: write
|
13
|
+
id-token: write
|
14
|
+
packages: write
|
11
15
|
steps:
|
12
|
-
- uses: actions/checkout@
|
16
|
+
- uses: actions/checkout@v4
|
13
17
|
with:
|
14
18
|
fetch-depth: 0 # Fetch current tag as annotated. See https://github.com/actions/checkout/issues/290
|
15
19
|
- uses: ruby/setup-ruby@v1
|
16
20
|
with:
|
17
|
-
ruby-version:
|
21
|
+
ruby-version: "3.3"
|
18
22
|
- name: "Extract data from tag: version, message, body"
|
19
23
|
id: tag
|
20
24
|
run: |
|
@@ -75,8 +79,8 @@ jobs:
|
|
75
79
|
GEM_HOST_API_KEY: Bearer ${{ secrets.GITHUB_TOKEN }}
|
76
80
|
run: |
|
77
81
|
gem push graphql-anycable-${{ steps.tag.outputs.version }}.gem --host https://rubygems.pkg.github.com/${{ github.repository_owner }}
|
82
|
+
- name: Configure RubyGems Credentials
|
83
|
+
uses: rubygems/configure-rubygems-credentials@main
|
78
84
|
- name: Publish to RubyGems
|
79
|
-
env:
|
80
|
-
GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_API_KEY }}"
|
81
85
|
run: |
|
82
86
|
gem push graphql-anycable-${{ steps.tag.outputs.version }}.gem
|
data/.github/workflows/test.yml
CHANGED
@@ -10,7 +10,7 @@ on:
|
|
10
10
|
|
11
11
|
jobs:
|
12
12
|
test:
|
13
|
-
name: "GraphQL-Ruby ${{ matrix.graphql }} on Ruby ${{ matrix.ruby }} (use_client_id: ${{ matrix.client_id }})"
|
13
|
+
name: "GraphQL-Ruby ${{ matrix.graphql }} on Ruby ${{ matrix.ruby }} (use_client_id: ${{ matrix.client_id }}) Redis v${{ matrix.redis_version }}"
|
14
14
|
runs-on: ubuntu-latest
|
15
15
|
strategy:
|
16
16
|
fail-fast: false
|
@@ -20,14 +20,17 @@ jobs:
|
|
20
20
|
graphql: '~> 2.0.0'
|
21
21
|
client_id: 'false'
|
22
22
|
anycable_rails: '~> 1.3'
|
23
|
+
redis_version: latest
|
23
24
|
- ruby: "3.0"
|
24
25
|
graphql: '~> 1.13.0'
|
25
26
|
client_id: 'false'
|
26
27
|
anycable_rails: '~> 1.2.0'
|
28
|
+
redis_version: 5.0.4
|
27
29
|
- ruby: 2.7
|
28
30
|
graphql: '~> 1.12.0'
|
29
31
|
client_id: 'true'
|
30
32
|
anycable_rails: '~> 1.1.0'
|
33
|
+
redis_version: 4.0.14
|
31
34
|
container:
|
32
35
|
image: ruby:${{ matrix.ruby }}
|
33
36
|
env:
|
@@ -35,9 +38,18 @@ jobs:
|
|
35
38
|
GRAPHQL_RUBY_VERSION: ${{ matrix.graphql }}
|
36
39
|
ANYCABLE_RAILS_VERSION: ${{ matrix.anycable_rails }}
|
37
40
|
GRAPHQL_ANYCABLE_USE_CLIENT_PROVIDED_UNIQ_ID: ${{ matrix.client_id }}
|
41
|
+
REDIS_URL: redis://redis:6379
|
42
|
+
services:
|
43
|
+
redis:
|
44
|
+
image: redis:${{ matrix.redis_version }}
|
45
|
+
options: >-
|
46
|
+
--health-cmd "redis-cli ping"
|
47
|
+
--health-interval 10s
|
48
|
+
--health-timeout 5s
|
49
|
+
--health-retries 5
|
38
50
|
steps:
|
39
|
-
- uses: actions/checkout@
|
40
|
-
- uses: actions/cache@
|
51
|
+
- uses: actions/checkout@v3
|
52
|
+
- uses: actions/cache@v3
|
41
53
|
with:
|
42
54
|
path: vendor/bundle
|
43
55
|
key: bundle-${{ matrix.ruby }}-${{ matrix.graphql }}-${{ matrix.anycable }}-${{ hashFiles('**/*.gemspec') }}-${{ hashFiles('**/Gemfile') }}
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
7
7
|
|
8
8
|
## Unreleased
|
9
9
|
|
10
|
+
## 1.1.7 - 2024-05-08
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
|
14
|
+
- Depend on `anycable-core` gem instead of `anycable`.
|
15
|
+
|
16
|
+
This allows to avoid installing `grpc` gem when using alternate AnyCable broadcasting adapters (like HTTP).
|
17
|
+
|
18
|
+
See https://github.com/anycable/graphql-anycable/issues/43 for details.
|
19
|
+
|
20
|
+
## 1.1.6 - 2023-08-03
|
21
|
+
|
22
|
+
### Fixed
|
23
|
+
|
24
|
+
- Fix empty operation name handling when using redis-client or redis.rb v5. [@ilyasgaraev] ([#34](https://github.com/anycable/graphql-anycable/pull/34))
|
25
|
+
- Fix deprecation warnings for redis.rb v4.8+ and support for redis.rb v5. [@smasry] ([#29](https://github.com/anycable/graphql-anycable/pull/29))
|
26
|
+
|
10
27
|
## 1.1.5 - 2022-10-26
|
11
28
|
|
12
29
|
- Fix that deprecation warning about `config.use_client_provided_uniq_id` again, so it can be issued outside of Rails. [@gsamokovarov] ([#27](https://github.com/anycable/graphql-anycable/pull/27))
|
@@ -168,6 +185,8 @@ Technical release to test publishing via GitHub Actions.
|
|
168
185
|
|
169
186
|
Initial version: store subscriptions on redis, re-execute queries in sync. [@Envek]
|
170
187
|
|
188
|
+
[@ilyasgaraev]: https://github.com/ilyasgaraev "Ilyas Garaev"
|
189
|
+
[@smasry]: https://github.com/smasry "Samer Masry"
|
171
190
|
[@gsamokovarov]: https://github.com/gsamokovarov "Genadi Samokovarov"
|
172
191
|
[@bibendi]: https://github.com/bibendi "Misha Merkushin"
|
173
192
|
[@FX-HAO]: https://github.com/FX-HAO "Fuxin Hao"
|
data/Gemfile
CHANGED
@@ -9,7 +9,7 @@ gemspec
|
|
9
9
|
|
10
10
|
gem "graphql", ENV.fetch("GRAPHQL_RUBY_VERSION", "~> 1.12")
|
11
11
|
gem "anycable", ENV.fetch("ANYCABLE_VERSION", "~> 1.0")
|
12
|
-
gem "anycable-rails", ENV.fetch("ANYCABLE_RAILS_VERSION", "~> 1.
|
12
|
+
gem "anycable-rails", ENV.fetch("ANYCABLE_RAILS_VERSION", "~> 1.3")
|
13
13
|
|
14
14
|
group :development, :test do
|
15
15
|
gem "pry"
|
@@ -17,7 +17,4 @@ group :development, :test do
|
|
17
17
|
|
18
18
|
gem "rubocop"
|
19
19
|
gem "rubocop-rspec"
|
20
|
-
|
21
|
-
# See https://github.com/guilleiguaran/fakeredis/pull/247
|
22
|
-
gem "fakeredis", github: 'guilleiguaran/fakeredis'
|
23
20
|
end
|
data/README.md
CHANGED
@@ -209,6 +209,14 @@ As in AnyCable there is no place to store subscription data in-memory, it should
|
|
209
209
|
=> 52ee8d65-275e-4d22-94af-313129116388
|
210
210
|
```
|
211
211
|
|
212
|
+
## Testing applications which use `graphql-anycable`
|
213
|
+
|
214
|
+
You can pass custom redis-server URL to AnyCable using ENV variable.
|
215
|
+
|
216
|
+
```bash
|
217
|
+
REDIS_URL=redis://localhost:6379/5 bundle exec rspec
|
218
|
+
```
|
219
|
+
|
212
220
|
## Development
|
213
221
|
|
214
222
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/graphql-anycable.gemspec
CHANGED
@@ -26,14 +26,13 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
27
|
spec.require_paths = ["lib"]
|
28
28
|
|
29
|
-
spec.add_dependency "anycable",
|
29
|
+
spec.add_dependency "anycable-core", "~> 1.1"
|
30
30
|
spec.add_dependency "anyway_config", ">= 1.3", "< 3"
|
31
31
|
spec.add_dependency "graphql", ">= 1.11", "< 3"
|
32
32
|
spec.add_dependency "redis", ">= 4.2.0"
|
33
33
|
|
34
34
|
spec.add_development_dependency "anycable-rails"
|
35
35
|
spec.add_development_dependency "bundler", "~> 2.0"
|
36
|
-
spec.add_development_dependency "fakeredis"
|
37
36
|
spec.add_development_dependency "rack"
|
38
37
|
spec.add_development_dependency "railties"
|
39
38
|
spec.add_development_dependency "rake", ">= 12.3.3"
|
@@ -156,16 +156,16 @@ module GraphQL
|
|
156
156
|
query_string: query.query_string,
|
157
157
|
variables: query.provided_variables.to_json,
|
158
158
|
context: @serializer.dump(context.to_h),
|
159
|
-
operation_name: query.operation_name,
|
159
|
+
operation_name: query.operation_name.to_s,
|
160
160
|
events: events.map { |e| [e.topic, e.fingerprint] }.to_h.to_json,
|
161
161
|
}
|
162
162
|
|
163
163
|
redis.multi do |pipeline|
|
164
|
-
pipeline.sadd(CHANNEL_PREFIX + channel_uniq_id, subscription_id)
|
164
|
+
pipeline.sadd(CHANNEL_PREFIX + channel_uniq_id, [subscription_id])
|
165
165
|
pipeline.mapped_hmset(SUBSCRIPTION_PREFIX + subscription_id, data)
|
166
166
|
events.each do |event|
|
167
167
|
pipeline.zincrby(FINGERPRINTS_PREFIX + event.topic, 1, event.fingerprint)
|
168
|
-
pipeline.sadd(SUBSCRIPTIONS_PREFIX + event.fingerprint, subscription_id)
|
168
|
+
pipeline.sadd(SUBSCRIPTIONS_PREFIX + event.fingerprint, [subscription_id])
|
169
169
|
end
|
170
170
|
next unless config.subscription_expiration_seconds
|
171
171
|
pipeline.expire(CHANNEL_PREFIX + channel_uniq_id, config.subscription_expiration_seconds)
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-anycable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Novikov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: anycable
|
14
|
+
name: anycable-core
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: anyway_config
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,20 +106,6 @@ dependencies:
|
|
106
106
|
- - "~>"
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '2.0'
|
109
|
-
- !ruby/object:Gem::Dependency
|
110
|
-
name: fakeredis
|
111
|
-
requirement: !ruby/object:Gem::Requirement
|
112
|
-
requirements:
|
113
|
-
- - ">="
|
114
|
-
- !ruby/object:Gem::Version
|
115
|
-
version: '0'
|
116
|
-
type: :development
|
117
|
-
prerelease: false
|
118
|
-
version_requirements: !ruby/object:Gem::Requirement
|
119
|
-
requirements:
|
120
|
-
- - ">="
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
version: '0'
|
123
109
|
- !ruby/object:Gem::Dependency
|
124
110
|
name: rack
|
125
111
|
requirement: !ruby/object:Gem::Requirement
|
@@ -185,7 +171,7 @@ extra_rdoc_files: []
|
|
185
171
|
files:
|
186
172
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
187
173
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
188
|
-
- ".github/workflows/
|
174
|
+
- ".github/workflows/release.yml"
|
189
175
|
- ".github/workflows/test.yml"
|
190
176
|
- ".gitignore"
|
191
177
|
- ".rspec"
|
@@ -227,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
227
213
|
- !ruby/object:Gem::Version
|
228
214
|
version: '0'
|
229
215
|
requirements: []
|
230
|
-
rubygems_version: 3.
|
216
|
+
rubygems_version: 3.5.9
|
231
217
|
signing_key:
|
232
218
|
specification_version: 4
|
233
219
|
summary: A drop-in replacement for GraphQL ActionCable subscriptions for AnyCable.
|