graphql-anycable 1.1.5 → 1.1.6

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
  SHA256:
3
- metadata.gz: 6ca5a3b41eb78aa4576b57f089f7f10ef2d8a86b5d1dfc8fe0742074b7c65f6a
4
- data.tar.gz: 7adef9ef6f064e3e38e70ba785f1deaba9af93e1149850743dd120e7bd079e07
3
+ metadata.gz: 0c3d8264a1ad4045379531d78a2b2d80507c1b37c2e98ca78370182258c20a79
4
+ data.tar.gz: 237d5b34c060675f21b97f0a08a12c70bb94795f08796dfdedc2e01971471ceb
5
5
  SHA512:
6
- metadata.gz: 01f0e4124e5b3c5eba6bd1996fa84a743e4c850553189a71661655e327877c360ee511bda4426d72e5bcbb940cb6625de2e445a427b3d1ff6fc44e07aeacc3af
7
- data.tar.gz: 6375ad885634e2f5f50ef60d7a5bc36e64d295143f704e817bdf8234f7bd6ec343677824bd5442c7a3e91af97a6c4a297a50f4ce93261e28d26ce9bf7726a6a2
6
+ metadata.gz: 4352ab99658356eb39f60048dff9a9a8c7b4968d4b5f50122f6e56534ebbec3f5d1fbd2b320f73b83e5001e0eb1d73904690a03831a8d7a54ef5b38231365fe1
7
+ data.tar.gz: b0fa928b0d187607d25bb6fedf4511bff6288fa6f82a88182bb892ad936922fe569da681ffff227ba88443b43f625e8d8ed007f300a891f39392a747948dd600
@@ -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@v2
40
- - uses: actions/cache@v2
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,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## 1.1.6 - 2023-08-03
11
+
12
+ ### Fixed
13
+
14
+ - Fix empty operation name handling when using redis-client or redis.rb v5. [@ilyasgaraev] ([#34](https://github.com/anycable/graphql-anycable/pull/34))
15
+ - Fix deprecation warnings for redis.rb v4.8+ and support for redis.rb v5. [@smasry] ([#29](https://github.com/anycable/graphql-anycable/pull/29))
16
+
10
17
  ## 1.1.5 - 2022-10-26
11
18
 
12
19
  - 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 +175,8 @@ Technical release to test publishing via GitHub Actions.
168
175
 
169
176
  Initial version: store subscriptions on redis, re-execute queries in sync. [@Envek]
170
177
 
178
+ [@ilyasgaraev]: https://github.com/ilyasgaraev "Ilyas Garaev"
179
+ [@smasry]: https://github.com/smasry "Samer Masry"
171
180
  [@gsamokovarov]: https://github.com/gsamokovarov "Genadi Samokovarov"
172
181
  [@bibendi]: https://github.com/bibendi "Misha Merkushin"
173
182
  [@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.2")
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.
@@ -33,7 +33,6 @@ Gem::Specification.new do |spec|
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"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GraphQL
4
4
  module AnyCable
5
- VERSION = "1.1.5"
5
+ VERSION = "1.1.6"
6
6
  end
7
7
  end
@@ -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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-anycable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Novikov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-26 00:00:00.000000000 Z
11
+ date: 2023-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anycable
@@ -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