Skip to content
On this page

Directus Cloud

Everything you need to start building. Provisioned in 90 seconds. Starting at $15/month.

Get Started

This is an auto-generated document to support extension builders understand the internal packages they can utilize. To find our written guides, tutorials, and API/SDK reference, check out our main docs .

Directus / @directus/sdk / types / ApplyQueryFields

Type Alias: ApplyQueryFields<Schema, Collection, ReadonlyFields, CollectionItem, Fields, RelationalFields, RelationalKeys, FlatFields> ​

ApplyQueryFields<Schema, Collection, ReadonlyFields, CollectionItem, Fields, RelationalFields, RelationalKeys, FlatFields>: IfAny<Schema, Record<string, any>, Prettify<Merge<MappedFunctionFields<Schema, CollectionItem> extends infer FF ? MapFlatFields<CollectionItem, FlatFields, FF extends Record<string, string> ? FF : Record<string, string>> : never, RelationalFields extends never ? never : { [Field in keyof RelationalFields]: Field extends keyof CollectionItem ? Extract<CollectionItem[Field], ItemType<Schema>> extends infer RelatedCollection ? RelationNullable<CollectionItem[Field], RelatedCollection extends any[] ? HasManyToAnyRelation<(...)> extends never ? (...) | (...) : (...)[] : ApplyNestedQueryFields<Schema, RelatedCollection, (...)[(...)]>> : never : never }>>>

Apply the configured fields query parameter on a given Item type

Type Parameters ​

• Schema

• Collection extends object

• ReadonlyFields

• CollectionItem extends object = UnpackList<Collection>

• Fields = UnpackList<Mutable<ReadonlyFields>>

• RelationalFields = PickRelationalFields<Fields>

• RelationalKeys extends keyof RelationalFields = RelationalFields extends never ? never : keyof RelationalFields

• FlatFields extends keyof CollectionItem = FieldsWildcard<CollectionItem, Exclude<Fields, RelationalKeys>>

Defined in ​

types/output.ts:9