- Docs
- API reference
- Endpoints and schemas
- GraphQL
- Directives
@dateAccessible
Computes the date-accessible value from a period end date.
Directives. This directive runs after the query has its answer. It changes what you see, not what the query reads.
Computes the date-accessible value from a period end date. Returns the 15th day of +3 months from the input date. Example: _fn @dateAccessible(ref: “periodEndDate”) with ‘2025-08-30’ returns ‘2025-11-15’.
Arguments
Section titled “Arguments”| Argument | Type | Description |
|---|---|---|
ref |
String |
A dot path to one value in the response, relative to the object that holds _fn. Each segment is a field name or alias, a list index, or * for every item of a list. Write ref or refs as the first argument of the directive. |
refs |
[String!] |
A list of dot paths to dates. The directive uses the first value only. |
Where it goes
Section titled “Where it goes”FIELD.
Example
Section titled “Example”query { search(searchInput: { entityType: BRAND name: "Safeway" conditions: { limit: 1 } }) { ... on Brand { id cardTransactions(first: 1) { edges { node { period } } } accessible: _fn @dateAccessible(refs: ["cardTransactions.edges.0.node.period"]) } }}Response, as returned:
{ "data": { "search": [ { "id": "0f26fbef-3436-4f85-8bcd-31fe12a4f99a", "cardTransactions": { "edges": [ { "node": { "period": "1m" } } ] }, "accessible": null } ] }}