SchemaCoordinatesMaxAgeProvider
class SchemaCoordinatesMaxAgeProvider(maxAges: Map<String, MaxAge>, defaultMaxAge: Duration) : MaxAgeProvider
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.