Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion content/_partials/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ Requests can be authenticated in the following ways:
Using a query parameter for authentication can lead to it being revealed or logged. If possible, use another method.
::
::
::
6 changes: 3 additions & 3 deletions content/_partials/query-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ The syntax for using a function is `function(field)`.
| `week` | Extract the week from a datetime/date/timestamp field |
| `day` | Extract the day from a datetime/date/timestamp field |
| `weekday` | Extract the weekday from a datetime/date/timestamp field |
| `hour` | Extract the hour from a datetime/date/timestamp field |
| `minute` | Extract the minute from a datetime/date/timestamp field |
| `second` | Extract the second from a datetime/date/timestamp field |
| `hour` | Extract the hour from a datetime/time/timestamp field |
| `minute` | Extract the minute from a datetime/time/timestamp field |
| `second` | Extract the second from a datetime/time/timestamp field |
| `count` | Extract the number of items from a JSON array or relational field |
| `json` | Extract a specific value from a JSON field using path notation |
1 change: 0 additions & 1 deletion content/guides/04.connect/2.filter-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ In the above, `categories` is the relational field in the collection. `_none` ch
```
::
::
::

::example
**Nested user and role variables in permissions**
Expand Down
2 changes: 0 additions & 2 deletions content/guides/04.connect/4.relations.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ use this same structure to select what the related items are:
```
::
::
::

You can also provide an object instead of a primary key in order to create new items nested on the fly, or an object
with a primary key included to update an existing item:
Expand Down Expand Up @@ -150,7 +149,6 @@ with a primary key included to update an existing item:
```
::
::
::

To remove items from this relationship, omit them from the array:

Expand Down
6 changes: 0 additions & 6 deletions content/guides/04.connect/6.sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ The Directus SDK is a "Composable Client" that allows you to customize and build

::callout{icon="material-symbols:school-outline" color="secondary" to="/tutorials/tips-and-tricks/advanced-types-with-the-directus-sdk"}
Learn how to create a Schema for SDK client creation.
::
::
::


Expand Down Expand Up @@ -113,7 +111,6 @@ To call custom endpoints using the SDK, you can manually provide a path and meth
---
label: JavaScript
---

```js
import { createDirectus, rest } from '@directus/sdk';
const directus = createDirectus('http://directus.example.com').with(rest());
Expand All @@ -123,9 +120,7 @@ To call custom endpoints using the SDK, you can manually provide a path and meth
method: 'GET',
}));
```

::

::div{class="pr-6"}
---
label: TypeScript
Expand All @@ -139,7 +134,6 @@ To call custom endpoints using the SDK, you can manually provide a path and meth
method: 'GET',
}));
```
::
::

### GraphQL Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ interface CollectionA {
}
```

There are currently 3 literal types that can be applied. The first 2 are both used to apply the `count(field)`
There are currently 5 literal types that can be applied. The first 2 are both used to apply the `count(field)`
array function in the `filter`/`field` auto-complete suggestions, these are the
`'json'` and `'csv'` string literal types. The `'datetime'` string literal type which is used to apply all
datetime functions in the `filter`/`field` auto-complete suggestions.
`'json'` and `'csv'` string literal types. The `'datetime'`, `'date'`, and `'time'` string literal types which are used to apply related functions in the `filter`/`field` auto-complete suggestions.

```ts
interface CollectionA {
Expand All @@ -96,13 +95,15 @@ interface CollectionA {
tags: 'csv'; // [!code ++]
json_field: 'json'; // [!code ++]
date_created: 'datetime'; // [!code ++]
start_time: 'time'; // [!code ++]
event_date: 'date'; // [!code ++]
}
```

In the output types these string literals will get resolved to their appropriate types:

- `'csv'` resolves to `string[]`
- `'datetime'` resolves to `string`
- `'datetime'`, `'date'`, and `'time'` resolve to `string`
- `'json'` resolves to [`JsonValue`](https://github.com/directus/directus/blob/main/sdk/src/types/output.ts#L105)

::callout{icon="material-symbols:warning-rounded" color="warning"}
Expand Down