QueryRef.FetchPolicy

enum QueryRef.FetchPolicy : Enum


The caching policy to use in QueryRef.execute.

Summary

Enum Values

CACHE_ONLY

Return the query result from the cache without any communication with the server.

PREFER_CACHE

If the query has a cached result that has not expired, then return it without any communication with the server, just as CACHE_ONLY would do.

SERVER_ONLY

Unconditionally get the latest result from the server, even if there is a locally-cached result for the query.

Public functions

QueryRef.FetchPolicy
valueOf(value: String)

Returns the enum constant of this type with the specified name.

Array<QueryRef.FetchPolicy>

Returns an array containing the constants of this enum type, in the order they're declared.

Enum Values

CACHE_ONLY

val QueryRef.FetchPolicy.CACHE_ONLYQueryRef.FetchPolicy

Return the query result from the cache without any communication with the server. If there is no cached data for the query then return an empty/null result, just as the server would have returned in that case.

PREFER_CACHE

val QueryRef.FetchPolicy.PREFER_CACHEQueryRef.FetchPolicy

If the query has a cached result that has not expired, then return it without any communication with the server, just as CACHE_ONLY would do. Otherwise, if there is no cached data for the query or the cached data has expired, then get the latest result from the server, just as SERVER_ONLY would do.

SERVER_ONLY

val QueryRef.FetchPolicy.SERVER_ONLYQueryRef.FetchPolicy

Unconditionally get the latest result from the server, even if there is a locally-cached result for the query. The local cache will be updated with the result, if successful.

Public functions

valueOf

fun valueOf(value: String): QueryRef.FetchPolicy

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Throws
kotlin.IllegalArgumentException: kotlin.IllegalArgumentException

if this enum type has no constant with the specified name

values

fun values(): Array<QueryRef.FetchPolicy>

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.