Skip to content

Commit 02013c3

Browse files
committed
update comments
1 parent 4b3aafe commit 02013c3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Validator/ValidationCache.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
/**
1111
* Implement this interface and pass an instance to GraphQL::executeQuery to enable caching of successful query validations.
1212
*
13-
* This can improve performance by skipping validation for known-good query and schema combinations.
14-
* You are responsible for defining how cache keys are computed, and when validation should be skipped.
13+
* This can improve performance by skipping validation for known-good query, schema, and rules combinations.
14+
* You are responsible for defining how cache keys are computed.
1515
*
1616
* @see PsrValidationCacheAdapter for a toy implementation.
1717
*/
@@ -35,7 +35,7 @@ public function isValidated(Schema $schema, DocumentNode $ast, array $rules = nu
3535
/**
3636
* @param array<ValidationRule>|null $rules
3737
*
38-
* Mark the given schema + AST pair as successfully validated.
38+
* Mark the given schema/AST/rules set as successfully validated.
3939
*
4040
* This is typically called after a query passes validation.
4141
* You should store enough information to recognize this combination on future requests.

tests/PsrValidationCacheAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function markValidated(Schema $schema, DocumentNode $ast, array $rules =
7070
private function buildKey(Schema $schema, DocumentNode $ast, array $rules = null): string
7171
{
7272
/**
73-
* This default strategy generates a cache key by hashing the printed schema and AST.
73+
* This default strategy generates a cache key by hashing the printed schema, AST, and any custom rules.
7474
* You'll likely want to replace this with a more stable or efficient method for fingerprinting the schema.
7575
* For example, you may use a build-time hash, schema version number, or an environment-based identifier.
7676
*/

0 commit comments

Comments
 (0)