graphql-persisted_queries 1.2.1 → 1.2.2

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: 4ae3a956abf426513fde7370b4e90e4677b227a43a800a67e0094e05439a06a1
4
- data.tar.gz: 918f9fd46776d26a849cf858f4b791594ce694702cbae5f453672829c070f0fb
3
+ metadata.gz: 51e6b75b3baabc1ace75eab3b689bcbb6ee7082362036d6fc0dc70858f803a04
4
+ data.tar.gz: 4db1546160fd4ca16f9a67899b6e4cbd97140f75afa689e0214d3d7197ee729f
5
5
  SHA512:
6
- metadata.gz: 69a31f10dd9e701fd7b00e28f40e4a51abc3b78d8d7a76bc0c670dd8c5a9fd4ef87b8e2df65d5128a092a636855b4c8940fbe0f8ba25d4136e8cc7c3200d7d80
7
- data.tar.gz: 11352cf7e1ec1e5d02e3445bc59598971e62bb5937964c31dc9e6d6883960f0b79c1895afbab231e7c0c61f2de211653f208326d880d07d9e5b67c7713681bbb
6
+ metadata.gz: aa30f3bddf9c7f933cc62d69199bceb5c55a430e8b3eca8e36c8eb9e1c78bb71f285b1f849b448e81fcb980afa9e5e2c6c4bc34e26041b6a612e830a8e4548a1
7
+ data.tar.gz: c1975bef00a57a1f18c37fde0811c5eb81d5ebfd8bd9704d02f05924e42251aa2c83f3008d7b3f2ba71face9567f39df5a3d4f2cfbbfef61be04c6a610b0942c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 1.2.2 (2021-04-21)
6
+
7
+ - [PR#47](https://github.com/DmitryTsepelev/graphql-ruby-persisted_queries/pull/47) Properly initialize memory adapter inside RedisWithLocalCacheStoreAdapter ([@DmitryTsepelev][])
8
+
5
9
  ## 1.2.1 (2021-03-07)
6
10
 
7
11
  - [PR#43](https://github.com/DmitryTsepelev/graphql-ruby-persisted_queries/pull/43) Properly handle configuration when schema is inherited ([@DmitryTsepelev][])
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # GraphQL::PersistedQueries
2
2
 
3
- `GraphQL::PersistedQueries` is the implementation of [persisted queries](https://github.com/apollographql/apollo-link-persisted-queries) for [graphql-ruby](https://github.com/rmosolgo/graphql-ruby). With this plugin your backend will cache all the queries, while frontend will send the full query only when it's not found at the backend storage.
3
+ `GraphQL::PersistedQueries` is the implementation of [persisted queries](https://www.apollographql.com/docs/react/api/link/persisted-queries/) for [graphql-ruby](https://github.com/rmosolgo/graphql-ruby). With this plugin your backend will cache all the queries, while frontend will send the full query only when it's not found at the backend storage.
4
4
 
5
5
  - 🗑**Heavy query parameter will be omitted in most of cases** – network requests will become less heavy
6
6
  - 🤝**Clients share cached queries** – it's enough to miss cache only once for each unique query
@@ -15,20 +15,18 @@
15
15
 
16
16
  ## Getting started
17
17
 
18
- First of all, install and configure [apollo-link-persisted-queries](https://github.com/apollographql/apollo-link-persisted-queries) on the front–end side:
18
+ First of all, install and configure [apollo's persisted queries](https://www.apollographql.com/docs/react/api/link/persisted-queries/) on the front–end side:
19
19
 
20
20
  ```js
21
- import { createPersistedQueryLink } from "apollo-link-persisted-queries";
22
- import { createHttpLink } from "apollo-link-http";
23
- import { InMemoryCache } from "apollo-cache-inmemory";
24
- import ApolloClient from "apollo-client";
21
+ import { HttpLink, InMemoryCache, ApolloClient } from "@apollo/client";
22
+ import { createPersistedQueryLink } from "@apollo/client/link/persisted-queries";
23
+ import { sha256 } from 'crypto-hash';
25
24
 
26
-
27
- // use this with Apollo Client
28
- const link = createPersistedQueryLink().concat(createHttpLink({ uri: "/graphql" }));
25
+ const httpLink = new HttpLink({ uri: "/graphql" });
26
+ const persistedQueriesLink = createPersistedQueryLink({ sha256 });
29
27
  const client = new ApolloClient({
30
28
  cache: new InMemoryCache(),
31
- link: link,
29
+ link: persistedQueriesLink.concat(httpLink);
32
30
  });
33
31
  ```
34
32
 
@@ -95,9 +93,9 @@ When the error occurs, the gem tries to not interrupt the regular flow of the ap
95
93
 
96
94
  Since our queries are slim now, we can switch back to HTTP GET, you can find a [guide](docs/http_cache.md) here.
97
95
 
98
- [batch-link](https://www.apollographql.com/docs/link/links/batch-http/) allows to group queries on the client side into a single HTTP request before sending to the server. In this case you need to use `GraphqlSchema.multiplex(queries)` instead of `#execute`. The gem supports it too, no action required!
96
+ [batch-link](https://www.apollographql.com/docs/react/api/link/apollo-link-batch-http/) allows to group queries on the client side into a single HTTP request before sending to the server. In this case you need to use `GraphqlSchema.multiplex(queries)` instead of `#execute`. The gem supports it too, no action required!
99
97
 
100
- [apollo-link-persisted-queries](https://github.com/apollographql/apollo-link-persisted-queries) uses _SHA256_ for building hashes by default. Check out this [guide](docs/hash.md) if you want to override this behavior.
98
+ [persisted-queries-link](https://www.apollographql.com/docs/react/api/link/persisted-queries/) uses _SHA256_ for building hashes by default. Check out this [guide](docs/hash.md) if you want to override this behavior.
101
99
 
102
100
  An experimental tracing feature can be enabled by setting `tracing: true` when configuring the plugin. Read more about this feature in the [Tracing guide](docs/tracing.md).
103
101
 
@@ -18,7 +18,7 @@ module GraphQL
18
18
  expiration: expiration,
19
19
  namespace: namespace
20
20
  )
21
- @memory_adapter = memory_adapter_class.new(nil)
21
+ @memory_adapter = memory_adapter_class.new
22
22
  @name = :redis_with_local_cache
23
23
  end
24
24
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GraphQL
4
4
  module PersistedQueries
5
- VERSION = "1.2.1"
5
+ VERSION = "1.2.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-persisted_queries
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - DmitryTsepelev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-07 00:00:00.000000000 Z
11
+ date: 2021-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql