graphql-persisted_queries 0.5.1 → 1.0.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/CHANGELOG.md +4 -0
- data/README.md +5 -4
- data/docs/http_cache.md +8 -1
- data/lib/graphql/persisted_queries/multiplex_resolver.rb +1 -1
- data/lib/graphql/persisted_queries/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdeb7575727fd45b0b40fb17699bc02f700ad20f2475cfa8bb072691f4655d12
|
4
|
+
data.tar.gz: 60764c58124de88e7009d9c178dbd418272ffa6b5e965590e90638bf703e6f29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2d560698a4305ffab013db083faa2665a40bc68d698d2a634435c37efb650564369eabdde5019c1d73f63846318767e6e1012bb399ac16da9e7d492269bbc00
|
7
|
+
data.tar.gz: 6f708c05436af2c79df4329b7b12ee75a787bfbc71663834f8ab32ea5be678ed9d38a0942485c88e3e5bf890a749e87db6d3a0195b3e0e730f0dd8c04059d813
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 🥳 1.0.0 (2020-03-31)
|
6
|
+
|
7
|
+
- [PR#30](https://github.com/DmitryTsepelev/graphql-ruby-persisted_queries/pull/30) **BREAKING CHANGE** Move extenstions to the query context ([@DmitryTsepelev][])
|
8
|
+
|
5
9
|
## 0.5.1 (2020-03-18)
|
6
10
|
|
7
11
|
- [PR#33](https://github.com/DmitryTsepelev/graphql-ruby-persisted_queries/pull/33) Support AST analyzers ([@DmitryTsepelev][])
|
data/README.md
CHANGED
@@ -51,15 +51,16 @@ class GraphqlSchema < GraphQL::Schema
|
|
51
51
|
end
|
52
52
|
```
|
53
53
|
|
54
|
-
Pass `:extensions` argument to all calls of `GraphqlSchema#execute`, usually it happens in `GraphqlController`, `GraphqlChannel` and tests
|
54
|
+
Pass `:extensions` argument as part of a `context` to all calls of `GraphqlSchema#execute`, usually it happens in `GraphqlController`, `GraphqlChannel` and tests:
|
55
55
|
|
56
56
|
```ruby
|
57
57
|
GraphqlSchema.execute(
|
58
58
|
params[:query],
|
59
59
|
variables: ensure_hash(params[:variables]),
|
60
|
-
context: {
|
61
|
-
|
62
|
-
|
60
|
+
context: {
|
61
|
+
extensions: ensure_hash(params[:extensions])
|
62
|
+
},
|
63
|
+
operation_name: params[:operationName]
|
63
64
|
)
|
64
65
|
```
|
65
66
|
|
data/docs/http_cache.md
CHANGED
@@ -28,7 +28,14 @@ get "/graphql", to: "graphql#execute"
|
|
28
28
|
Put the request object to the GraphQL context everywhere you execute GraphQL queries:
|
29
29
|
|
30
30
|
```ruby
|
31
|
-
GraphqlSchema.execute(
|
31
|
+
GraphqlSchema.execute(
|
32
|
+
query,
|
33
|
+
variables: ensure_hash(params[:variables]),
|
34
|
+
context: {
|
35
|
+
extensions: ensure_hash(params[:extensions])
|
36
|
+
request: request
|
37
|
+
}
|
38
|
+
)
|
32
39
|
```
|
33
40
|
|
34
41
|
Turn the `verify_http_method` option when configuring the plugin to enforce using `POST` requests for performing mutations (otherwise the error `Mutations cannot be performed via HTTP GET` will be returned):
|
@@ -29,7 +29,7 @@ module GraphQL
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def resolve_persisted_query(query_params, pos)
|
32
|
-
extensions = query_params.
|
32
|
+
extensions = query_params.dig(:context, :extensions)
|
33
33
|
return unless extensions
|
34
34
|
|
35
35
|
query_params[:query] = Resolver.new(extensions, @schema).resolve(query_params[:query])
|
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: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DmitryTsepelev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|