-
- All Implemented Interfaces:
-
com.expediagroup.graphql.apq.cache.AutomaticPersistedQueriesCache
,graphql.execution.preparsed.persisted.PersistedQueryCache
public final class DefaultAutomaticPersistedQueriesCache implements AutomaticPersistedQueriesCache
-
-
Constructor Summary
Constructors Constructor Description DefaultAutomaticPersistedQueriesCache()
-
Method Summary
Modifier and Type Method Description CompletableFuture<PreparsedDocumentEntry>
getOrElse(String key, Function0<PreparsedDocumentEntry> supplier)
Get the PreparsedDocumentEntry associated with the key from the cache. -
-
Method Detail
-
getOrElse
CompletableFuture<PreparsedDocumentEntry> getOrElse(String key, Function0<PreparsedDocumentEntry> supplier)
Get the PreparsedDocumentEntry associated with the key from the cache.
If the PreparsedDocumentEntry is missing in the cache, the supplier will provide one, and then it should be added to the cache.
- Parameters:
key
- The hash of the requested query.supplier
- that will provide the document in case there is a cache miss.
-
-
-
-