Skip to content

Commit 9f9d093

Browse files
committed
Modify PreparsedDocumentProvider documentation
1 parent 05b95b0 commit 9f9d093

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

spring-graphql-docs/src/docs/asciidoc/index.adoc

+8-4
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,15 @@ name mappings that should help to cover more corner cases.
288288
[[execution-graphqlsource-preparsed-document-provider]]
289289
==== PreparsedDocumentProvider
290290

291-
You can configure a `PreparsedDocumentProvider` in `GraphQlSource.Builder` to implement `Document` caching and checks.
292-
Doing so makes it possible to skip the parsing and validation steps of execution entirely. It may also assist you
293-
in implementing query whitelisting.
291+
Before operations can be executed by GraphQL Java, their request string must be _parsed_ and _validated_. These
292+
two steps may impact the performance of applications significantly.
294293

295-
A simple caching implementation using Caffeine would look something like the following:
294+
You may configure a `PreparsedDocumentProvider` using `GraphQlSource.Builder#configureGraphQl`. The
295+
`PreparsedDocumentProvider` can intercept these two steps and gives library consumers the tools to
296+
cache, or modify the resulting operation.
297+
298+
The following snippet uses https://github.com/ben-manes/caffeine[Caffeine] to build a `PreparsedDocumentProvider`
299+
which caches the 2500 most recent operations for a maximum of 1 hour:
296300

297301
[source,java,indent=0,subs="verbatim,quotes"]
298302
----

0 commit comments

Comments
 (0)