SchemaCoordinatesMaxAgeProvider

A provider that returns a max age based on schema coordinates. The given coordinates must be object/interface/union (e.g. MyType) or field (e.g. MyType.myField) coordinates.

The max age of a field is determined as follows:

  • If the field has a MaxAge.Duration max age, return it.

  • Else, if the field has a MaxAge.Inherit max age, return the max age of the parent field.

  • Else, if the field's type has a MaxAge.Duration max age, return it.

  • Else, if the field's type has a MaxAge.Inherit max age, return the max age of the parent field.

  • Else, if the field is a root field, or the field's type is composite, return the default max age.

  • Else, return the max age of the parent field.

Then the lowest of the field's max age and its parent field's max age is returned.

Constructors

Link copied to clipboard
constructor(maxAges: Map<String, MaxAge>, defaultMaxAge: Duration)

Functions

Link copied to clipboard
open override fun getMaxAge(maxAgeContext: MaxAgeContext): Duration

Returns the max age for the given field.