mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 17:31:56 +03:00
85a2eb7a51
Redis-based caching: the endpoints related to clearing the cache and gathering cache metrics would sometimes miss keys. This has been remedied. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10843 GitOrigin-RevId: 4fafb17fc570b3dc2e265493f967f8b30eace46a
80 lines
2.0 KiB
YAML
80 lines
2.0 KiB
YAML
- description: call the simple endpoint to write to the cache
|
|
url: /v1/graphql
|
|
status: 200
|
|
query:
|
|
query: |
|
|
query @cached(ttl: 300) {
|
|
test_table {
|
|
first_name
|
|
last_name
|
|
}
|
|
}
|
|
resp_headers:
|
|
Cache-Control: max-age=300
|
|
X-Hasura-Query-Cache-Key: d4a71d5adf16ade24aef3c86a6db2a60c2bbf303
|
|
X-Hasura-Query-Family-Cache-Key: 5370009b358ff0d7725a05b0e999d28b16725671
|
|
response:
|
|
data:
|
|
test_table:
|
|
- first_name: Foo
|
|
last_name: Bar
|
|
- first_name: Baz
|
|
last_name: Qux
|
|
- first_name: X%20Y
|
|
last_name: Test
|
|
|
|
- description: call the simple endpoint to write to the cache
|
|
url: /v1/graphql
|
|
status: 200
|
|
query:
|
|
query: |
|
|
query ($name: String!) @cached(ttl: 300) {
|
|
test_table(where: {first_name: {_eq: $name}}) {
|
|
first_name
|
|
last_name
|
|
}
|
|
}
|
|
variables:
|
|
name: Baz
|
|
resp_headers:
|
|
Cache-Control: max-age=300
|
|
X-Hasura-Query-Cache-Key: ecfc0913788b5f9dc5e16e01a2584d0364d7ce27
|
|
X-Hasura-Query-Family-Cache-Key: 89e2d56a8a0c692199451a88c380586fb5146ade
|
|
response:
|
|
data:
|
|
test_table:
|
|
- first_name: Baz
|
|
last_name: Qux
|
|
|
|
- description: call the simple endpoint to write to the cache
|
|
url: /v1/graphql
|
|
status: 200
|
|
query:
|
|
query: |
|
|
query ($name: String!) @cached(ttl: 300) {
|
|
test_table(where: {first_name: {_eq: $name}}) {
|
|
first_name
|
|
last_name
|
|
}
|
|
}
|
|
variables:
|
|
name: Foo
|
|
resp_headers:
|
|
Cache-Control: max-age=300
|
|
X-Hasura-Query-Cache-Key: 160eecd4719070c396fc938d0ea09ab0b9d5b9b0
|
|
X-Hasura-Query-Family-Cache-Key: 89e2d56a8a0c692199451a88c380586fb5146ade
|
|
response:
|
|
data:
|
|
test_table:
|
|
- first_name: Foo
|
|
last_name: Bar
|
|
|
|
- description: call the cache clear endpoint
|
|
url: /pro/cache/clear?family=89e2d56a8a0c692199451a88c380586fb5146ade
|
|
method: POST
|
|
status: 200
|
|
query:
|
|
response:
|
|
message: success
|
|
clearedItemCount: 2
|