Skip to content

Commit

Permalink
Revert "Fix the query hashing algorithm (#6205)"
Browse files Browse the repository at this point in the history
This reverts commit c5e1246.
  • Loading branch information
abernix committed Jan 10, 2025
1 parent 1230fa1 commit e7321f8
Show file tree
Hide file tree
Showing 46 changed files with 279 additions and 1,851 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ expression: cache_keys
---
[
{
"key": "version:1.0:subgraph:orga:type:Organization:entity:5811967f540d300d249ab30ae681359a7815fdb5d3dc71a94be1d491006a6b27:hash:ab9056ba140750aa8fe58360172b450fa717e7ea177e4a3c9426fe1291a88da2:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c",
"key": "version:1.0:subgraph:orga:type:Organization:entity:5811967f540d300d249ab30ae681359a7815fdb5d3dc71a94be1d491006a6b27:hash:bfdf859dea9e38e1ea5530a470cd9d3331de3b3d3bacec71f67ada95160ae126:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c",
"status": "cached",
"cache_control": "public"
},
{
"key": "version:1.0:subgraph:user:type:Query:hash:0d4d253b049bbea514a54a892902fa4b9b658aedc9b8f2a1308323cdeef3c0ca:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c",
"key": "version:1.0:subgraph:user:type:Query:hash:15985941161a4bdd9f2b00b2e97ab33d8b2f375e2ab78afaffdb208231fe93bb:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c",
"status": "cached",
"cache_control": "public"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ expression: cache_keys
---
[
{
"key": "version:1.0:subgraph:orga:type:Organization:entity:5811967f540d300d249ab30ae681359a7815fdb5d3dc71a94be1d491006a6b27:hash:ab9056ba140750aa8fe58360172b450fa717e7ea177e4a3c9426fe1291a88da2:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c",
"key": "version:1.0:subgraph:orga:type:Organization:entity:5811967f540d300d249ab30ae681359a7815fdb5d3dc71a94be1d491006a6b27:hash:bfdf859dea9e38e1ea5530a470cd9d3331de3b3d3bacec71f67ada95160ae126:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c",
"status": "new",
"cache_control": "public"
},
{
"key": "version:1.0:subgraph:user:type:Query:hash:0d4d253b049bbea514a54a892902fa4b9b658aedc9b8f2a1308323cdeef3c0ca:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c",
"key": "version:1.0:subgraph:user:type:Query:hash:15985941161a4bdd9f2b00b2e97ab33d8b2f375e2ab78afaffdb208231fe93bb:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c",
"status": "new",
"cache_control": "public"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ expression: cache_keys
---
[
{
"key": "version:1.0:subgraph:orga:type:Organization:entity:5221ff42b311b757445c096c023cee4fefab5de49735e421c494f1119326317b:hash:4913f52405bb614177e7c718d43da695c2f0e7411707c2f77f1c62380153c8d8:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c",
"key": "version:1.0:subgraph:orga:type:Organization:entity:5221ff42b311b757445c096c023cee4fefab5de49735e421c494f1119326317b:hash:fc8c626beede25849752e711021eac9cf5e995c56a0a39e28f1916ecde4a0026:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c",
"status": "cached",
"cache_control": "[REDACTED]"
},
{
"key": "version:1.0:subgraph:orga:type:Organization:entity:5811967f540d300d249ab30ae681359a7815fdb5d3dc71a94be1d491006a6b27:hash:4913f52405bb614177e7c718d43da695c2f0e7411707c2f77f1c62380153c8d8:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c",
"key": "version:1.0:subgraph:orga:type:Organization:entity:5811967f540d300d249ab30ae681359a7815fdb5d3dc71a94be1d491006a6b27:hash:fc8c626beede25849752e711021eac9cf5e995c56a0a39e28f1916ecde4a0026:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c",
"status": "cached",
"cache_control": "[REDACTED]"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ expression: cache_keys
---
[
{
"key": "version:1.0:subgraph:orga:type:Organization:entity:5221ff42b311b757445c096c023cee4fefab5de49735e421c494f1119326317b:hash:4913f52405bb614177e7c718d43da695c2f0e7411707c2f77f1c62380153c8d8:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c",
"key": "version:1.0:subgraph:orga:type:Organization:entity:5221ff42b311b757445c096c023cee4fefab5de49735e421c494f1119326317b:hash:fc8c626beede25849752e711021eac9cf5e995c56a0a39e28f1916ecde4a0026:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c",
"status": "new",
"cache_control": "[REDACTED]"
},
{
"key": "version:1.0:subgraph:orga:type:Organization:entity:5811967f540d300d249ab30ae681359a7815fdb5d3dc71a94be1d491006a6b27:hash:4913f52405bb614177e7c718d43da695c2f0e7411707c2f77f1c62380153c8d8:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c",
"key": "version:1.0:subgraph:orga:type:Organization:entity:5811967f540d300d249ab30ae681359a7815fdb5d3dc71a94be1d491006a6b27:hash:fc8c626beede25849752e711021eac9cf5e995c56a0a39e28f1916ecde4a0026:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c",
"status": "new",
"cache_control": "[REDACTED]"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ expression: cache_keys
---
[
{
"key": "version:1.0:subgraph:orga:type:Organization:entity:5811967f540d300d249ab30ae681359a7815fdb5d3dc71a94be1d491006a6b27:hash:ab9056ba140750aa8fe58360172b450fa717e7ea177e4a3c9426fe1291a88da2:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c:03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4",
"key": "version:1.0:subgraph:orga:type:Organization:entity:5811967f540d300d249ab30ae681359a7815fdb5d3dc71a94be1d491006a6b27:hash:bfdf859dea9e38e1ea5530a470cd9d3331de3b3d3bacec71f67ada95160ae126:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c:03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4",
"status": "cached",
"cache_control": "private"
},
{
"key": "version:1.0:subgraph:user:type:Query:hash:0d4d253b049bbea514a54a892902fa4b9b658aedc9b8f2a1308323cdeef3c0ca:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c:03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4",
"key": "version:1.0:subgraph:user:type:Query:hash:15985941161a4bdd9f2b00b2e97ab33d8b2f375e2ab78afaffdb208231fe93bb:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c:03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4",
"status": "cached",
"cache_control": "private"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ expression: cache_keys
---
[
{
"key": "version:1.0:subgraph:orga:type:Organization:entity:5811967f540d300d249ab30ae681359a7815fdb5d3dc71a94be1d491006a6b27:hash:ab9056ba140750aa8fe58360172b450fa717e7ea177e4a3c9426fe1291a88da2:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c:03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4",
"key": "version:1.0:subgraph:orga:type:Organization:entity:5811967f540d300d249ab30ae681359a7815fdb5d3dc71a94be1d491006a6b27:hash:bfdf859dea9e38e1ea5530a470cd9d3331de3b3d3bacec71f67ada95160ae126:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c:03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4",
"status": "cached",
"cache_control": "private"
},
{
"key": "version:1.0:subgraph:user:type:Query:hash:0d4d253b049bbea514a54a892902fa4b9b658aedc9b8f2a1308323cdeef3c0ca:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c:03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4",
"key": "version:1.0:subgraph:user:type:Query:hash:15985941161a4bdd9f2b00b2e97ab33d8b2f375e2ab78afaffdb208231fe93bb:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c:03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4",
"status": "cached",
"cache_control": "private"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ expression: cache_keys
---
[
{
"key": "version:1.0:subgraph:orga:type:Organization:entity:5811967f540d300d249ab30ae681359a7815fdb5d3dc71a94be1d491006a6b27:hash:ab9056ba140750aa8fe58360172b450fa717e7ea177e4a3c9426fe1291a88da2:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c",
"key": "version:1.0:subgraph:orga:type:Organization:entity:5811967f540d300d249ab30ae681359a7815fdb5d3dc71a94be1d491006a6b27:hash:bfdf859dea9e38e1ea5530a470cd9d3331de3b3d3bacec71f67ada95160ae126:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c",
"status": "new",
"cache_control": "private"
},
{
"key": "version:1.0:subgraph:user:type:Query:hash:0d4d253b049bbea514a54a892902fa4b9b658aedc9b8f2a1308323cdeef3c0ca:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c:03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4",
"key": "version:1.0:subgraph:user:type:Query:hash:15985941161a4bdd9f2b00b2e97ab33d8b2f375e2ab78afaffdb208231fe93bb:data:d9d84a3c7ffc27b0190a671212f3740e5b8478e84e23825830e97822e25cf05c:03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4",
"status": "new",
"cache_control": "private"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ expression: query_plan
"inputRewrites": null,
"outputRewrites": null,
"contextRewrites": null,
"schemaAwareHash": "343157a7d5b7929ebdc0c17cbf0f23c8d3cf0c93a820856d3a189521cc2f24a2",
"schemaAwareHash": "8ffa028a5aed384f5ad1116ab5a94cd26d90d38e55bb8a95e3b847a7863a49a5",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ expression: query_plan
"inputRewrites": null,
"outputRewrites": null,
"contextRewrites": null,
"schemaAwareHash": "df2a0633d70ab97805722bae920647da51b7eb821b06d8a2499683c5c7024316",
"schemaAwareHash": "30e3f34574b6a43bb731de8f76b113d845c12f7c07ed00eaf8762107325802b1",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down Expand Up @@ -63,7 +63,7 @@ expression: query_plan
"inputRewrites": null,
"outputRewrites": null,
"contextRewrites": null,
"schemaAwareHash": "56ac7a7cc11b7f293acbdaf0327cb2b676415eab8343e9259322a1609c90455e",
"schemaAwareHash": "ea1b0945910928c41362204ca23e95924d70c4ff1ac66483645e94dff06e6c2c",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ expression: "serde_json::to_value(response).unwrap()"
"inputRewrites": null,
"outputRewrites": null,
"contextRewrites": null,
"schemaAwareHash": "45b4beebcbf1df72ab950db7bd278417712b1aa39119317f44ad5b425bdb6997",
"schemaAwareHash": "4d7744c8b45e9ab9ae0b4b739335904878872023793c7e269b7649ddac90a189",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down Expand Up @@ -109,7 +109,7 @@ expression: "serde_json::to_value(response).unwrap()"
"inputRewrites": null,
"outputRewrites": null,
"contextRewrites": null,
"schemaAwareHash": "645f3f8763133d2376e33ab3d1145be7ded0ccc8e94e20aba1fbaa34a51633da",
"schemaAwareHash": "34900a19d589dbe2f15802a7ff36d198752af04d44ba6150fa226443871df07c",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down Expand Up @@ -156,7 +156,7 @@ expression: "serde_json::to_value(response).unwrap()"
"inputRewrites": null,
"outputRewrites": null,
"contextRewrites": null,
"schemaAwareHash": "a79f69245d777abc4afbd7d0a8fc434137fa4fd1079ef082edf4c7746b5a0fcd",
"schemaAwareHash": "aafe1a73eaeec767664030cf6d0b9a385a4075ac74c992027c4293139afdb29c",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down Expand Up @@ -200,7 +200,7 @@ expression: "serde_json::to_value(response).unwrap()"
"inputRewrites": null,
"outputRewrites": null,
"contextRewrites": null,
"schemaAwareHash": "5ad94764f288a41312e07745510bf5dade2b63fb82c3d896f7d00408dbbe5cce",
"schemaAwareHash": "a76da96c78b57941fcedf7536d2f8b7b8a7241f0e90be0f802271ca0c788d3db",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ expression: "serde_json::to_value(response).unwrap()"
"inputRewrites": null,
"outputRewrites": null,
"contextRewrites": null,
"schemaAwareHash": "45b4beebcbf1df72ab950db7bd278417712b1aa39119317f44ad5b425bdb6997",
"schemaAwareHash": "4d7744c8b45e9ab9ae0b4b739335904878872023793c7e269b7649ddac90a189",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down Expand Up @@ -109,7 +109,7 @@ expression: "serde_json::to_value(response).unwrap()"
"inputRewrites": null,
"outputRewrites": null,
"contextRewrites": null,
"schemaAwareHash": "645f3f8763133d2376e33ab3d1145be7ded0ccc8e94e20aba1fbaa34a51633da",
"schemaAwareHash": "34900a19d589dbe2f15802a7ff36d198752af04d44ba6150fa226443871df07c",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down Expand Up @@ -156,7 +156,7 @@ expression: "serde_json::to_value(response).unwrap()"
"inputRewrites": null,
"outputRewrites": null,
"contextRewrites": null,
"schemaAwareHash": "a79f69245d777abc4afbd7d0a8fc434137fa4fd1079ef082edf4c7746b5a0fcd",
"schemaAwareHash": "aafe1a73eaeec767664030cf6d0b9a385a4075ac74c992027c4293139afdb29c",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down Expand Up @@ -200,7 +200,7 @@ expression: "serde_json::to_value(response).unwrap()"
"inputRewrites": null,
"outputRewrites": null,
"contextRewrites": null,
"schemaAwareHash": "5ad94764f288a41312e07745510bf5dade2b63fb82c3d896f7d00408dbbe5cce",
"schemaAwareHash": "a76da96c78b57941fcedf7536d2f8b7b8a7241f0e90be0f802271ca0c788d3db",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Fetch(
output_rewrites: None,
context_rewrites: None,
schema_aware_hash: QueryHash(
"65e550250ef331b8dc49d9e2da8f4cd5add979720cbe83ba545a0f78ece8d329",
"5c5036eef33484e505dd5a8666fd0a802e60d830964a4dbbf662526398563ffd",
),
authorization: CacheKeyMetadata {
is_authenticated: false,
Expand Down
4 changes: 1 addition & 3 deletions apollo-router/src/spec/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,7 @@ impl Query {
let operation = Operation::from_hir(&operation, schema, &mut defer_stats, &fragments)?;

let mut visitor =
QueryHashVisitor::new(schema.supergraph_schema(), &schema.raw_sdl, document).map_err(
|e| SpecError::QueryHashing(format!("could not calculate the query hash: {e}")),
)?;
QueryHashVisitor::new(schema.supergraph_schema(), &schema.raw_sdl, document);
traverse::document(&mut visitor, document, operation_name).map_err(|e| {
SpecError::QueryHashing(format!("could not calculate the query hash: {e}"))
})?;
Expand Down
Loading

0 comments on commit e7321f8

Please sign in to comment.