public class SimpleGraphQLCacheProvider extends Object implements GraphQLCacheProvider
| Modifier and Type | Class and Description |
|---|---|
static interface |
SimpleGraphQLCacheProvider.Config |
| Constructor and Description |
|---|
SimpleGraphQLCacheProvider() |
| Modifier and Type | Method and Description |
|---|---|
@Nullable String |
cacheQuery(@NotNull String query,
@NotNull String resourceType,
@Nullable String selectorString)
Stores the
query into the cache, potentially overriding a previous value. |
@Nullable String |
getQuery(@NotNull String hash,
@NotNull String resourceType,
@Nullable String selectorString)
Attempts to retrieve a previously persisted query from the cache.
|
@Nullable public @Nullable String getQuery(@NotNull @NotNull String hash, @NotNull @NotNull String resourceType, @Nullable @Nullable String selectorString)
GraphQLCacheProvidergetQuery in interface GraphQLCacheProviderhash - the query's SHA-256 hashresourceType - the resource type of the GraphQLServlet which will execute the
query, since multiple servlets can be registeredselectorString - the selector string with which the GraphQLServlet is registerednull otherwiseGraphQLCacheProvider.cacheQuery(String, String, String)@Nullable public @Nullable String cacheQuery(@NotNull @NotNull String query, @NotNull @NotNull String resourceType, @Nullable @Nullable String selectorString)
GraphQLCacheProviderquery into the cache, potentially overriding a previous value. The method will return the query's SHA-256 hash
if the persisting operation was successful. If not, a null value must be returned.cacheQuery in interface GraphQLCacheProviderquery - the GraphQL queryresourceType - the resource type of the GraphQLServlet which will execute the
query, since multiple servlets can be registeredselectorString - the selector string with which the GraphQLServlet is registerednull if the query could not be cachedCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.