You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- `request.operation.hash`- Hash of the normalized operation. Computed before variable remapping, so queries with different variable names produce different hashes. Identical queries with different skip/include variable values also produce different hashes because normalization inlines those directives.
68
+
- `request.operation.queryPlanHash`- The Hash used as the query plan cache key. Computed after variable remapping (e.g. `$myId` and `$eid` both become `$0`) and includes skip/include variable values. Two requests share the same `queryPlanHash` when they resolve to the same query plan.
69
+
- `request.operation.sha256Hash`- SHA-256 hash of the original operation query string sent by the client. Identical for all requests that send the same raw query body, regardless of variable values.
t.Run("validate queryPlanHash differs with skip/include variations", func(t*testing.T) {
4205
+
t.Parallel()
4206
+
4207
+
testenv.Run(t,
4208
+
&testenv.Config{
4209
+
AccessLogFields: []config.CustomAttribute{
4210
+
{
4211
+
Key: "sha256_hash",
4212
+
ValueFrom: &config.CustomDynamicAttribute{
4213
+
Expression: "request.operation.sha256Hash",
4214
+
},
4215
+
},
4216
+
{
4217
+
Key: "operation_hash",
4218
+
ValueFrom: &config.CustomDynamicAttribute{
4219
+
Expression: "request.operation.hash",
4220
+
},
4221
+
},
4222
+
{
4223
+
Key: "query_plan_hash",
4224
+
ValueFrom: &config.CustomDynamicAttribute{
4225
+
Expression: "request.operation.queryPlanHash",
4226
+
},
4227
+
},
4228
+
{
4229
+
Key: "plan_cache_hit",
4230
+
ValueFrom: &config.CustomDynamicAttribute{
4231
+
Expression: "request.operation.planCacheHit",
4232
+
},
4233
+
},
4234
+
},
4235
+
LogObservation: testenv.LogObservationConfig{
4236
+
Enabled: true,
4237
+
LogLevel: zapcore.InfoLevel,
4238
+
},
4239
+
}, func(t*testing.T, xEnv*testenv.Environment) {
4240
+
query:=`query Employee( $id: Int! = 4 $withAligators: Boolean! $withCats: Boolean! $skipDogs:Boolean! $skipMouses:Boolean! ) { employee(id: $id) { details { pets { name __typename ...AlligatorFields @include(if: $withAligators) ...CatFields @include(if: $withCats) ...DogFields @skip(if: $skipDogs) ...MouseFields @skip(if: $skipMouses) ...PonyFields @include(if: false) } } } } fragment AlligatorFields on Alligator { __typename class dangerous gender name } fragment CatFields on Cat { __typename class gender name type } fragment DogFields on Dog { __typename breed class gender name } fragment MouseFields on Mouse { __typename class gender name } fragment PonyFields on Pony { __typename class gender name }`
0 commit comments