includePaths
includePaths ⇒ Array.<string>
The paths an include names.
Kind: global constant
Returns: Array.<string> - Each path, trimmed, with empty ones left out.
| Param | Type | Description |
|---|---|---|
| [include] | string | Array.<string> | A comma-separated include, or an array of paths. |
topIncludes ⇒ Array.<string>
The relationships of the resource itself that an include reaches.
A nested path includes every relationship along it, so media.image names
media too.
Kind: global constant
Returns: Array.<string> - The first relationship of each path, once each.
| Param | Type | Description |
|---|---|---|
| [include] | string | Array.<string> | The include. |
Example
topIncludes('media.image,uid') // ['media', 'uid']
subIncludes ⇒ string
The paths below one relationship, relative to it.
Kind: global constant
Returns: string - The paths below it, comma-separated.
| Param | Type | Description |
|---|---|---|
| [include] | string | Array.<string> | The include. |
| key | string | The relationship. |
Example
subIncludes('media,media.image,media.image.file', 'media') // 'image,image.file'
fieldsWithIncludes ⇒ string
A type's sparse fieldset with the relationships an include names added.
Drupal leaves a relationship out of the document when the fieldset doesn't name it, so the store could not find what it included.
Kind: global constant
Returns: string - The fieldset, comma-separated, each field once.
| Param | Type | Description |
|---|---|---|
| fields | string | The type's comma-separated fieldset. |
| [include] | string | Array.<string> | The include. |
includesFor ⇒ string | Array.<string> | undefined
The include paths a resource's type can take.
Drupal answers 400 to an include a type lacks. When a query lists a type's fields, as schema mode lists the fields its display renders, a path whose relationship those fields don't name is left out, unless the resource is known to have that relationship.
Kind: global constant
Returns: string | Array.<string> | undefined - The paths it can take, comma-separated, or the include as given when nothing decides.
| Param | Type | Description |
|---|---|---|
| [include] | string | Array.<string> | The include. |
| [fields] | string | The type's comma-separated fieldset. Without one, the include is kept whole. |
| [relationships] | Array.<string> | Relationships the resource is known to have. |