Write cache entry

writeCacheEntry(projectReference: String!, key: String!, input: WriteCacheEntryInput!): CacheEntrySummary!

Requires project.cache.write.

Arguments

ArgumentTypeRequiredDescription
projectReferenceString!YesProject UUID or slug.
keyString!YesCache key, 1 to 512 characters.
inputWriteCacheEntryInput!Yes

Input fields

input

WriteCacheEntryInput

FieldTypeRequiredDescription
valueString!YesUTF-8 string value. Values over 1 KB are stored compressed.
ttlSecondsIntNoSeconds until the entry expires, 1 to 86400. Defaults to 300; the previous TTL is never kept.

Response

Returns CacheEntrySummary!. Open the type for its fields and nested types.

FieldTypeDescription
keyString!Cache key.
expiresAtDateTimeTime the entry expires; null for an entry written through the legacy no-expiry path (ttl=0).

Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.

Example

graphql
mutation WriteCacheEntry($projectReference: String!, $key: String!, $input: WriteCacheEntryInput!) {
  writeCacheEntry(projectReference: $projectReference, key: $key, input: $input) {
    expiresAt
    key
  }
}
json
{
  "projectReference": "00000000-0000-4000-8000-000000000001",
  "key": "example",
  "input": {
    "value": "example"
  }
}