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
Copy file name to clipboardExpand all lines: docs/executing-queries.md
+56-18Lines changed: 56 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -210,14 +210,15 @@ $server = new StandardServer([
210
210
'validationRules' => $myValidationRules
211
211
]);
212
212
```
213
+
213
214
## Validation Caching
214
215
215
-
Validation is a required step in GraphQL execution, but it can become a performance bottleneck when the same queries are
216
-
run repeatedly — especially in production environments where queries are often static or pre-generated (e.g., persisted
217
-
queries or queries emitted by client libraries).
216
+
Validation is a required step in GraphQL execution, but it can become a performance bottleneck.
217
+
In production environments, queries are often static or pre-generated (e.g. persisted queries or queries emitted by client libraries).
218
+
This means that many queries will be identical and their validation results can be reused.
218
219
219
-
To optimize for this, `graphql-php`supports pluggable validation caching. By implementing the `GraphQL\Validator\ValidationCache` interface and passing it to
220
-
`GraphQL::executeQuery()`, you can skip validation for queries that are already known to be valid.
220
+
To optimize for this, `graphql-php`allows skipping validation for known valid queries.
221
+
Leverage pluggable validation caching by passing an implementation of the `GraphQL\Validator\ValidationCache` interface to `GraphQL::executeQuery()`:
0 commit comments