> ## Documentation Index
> Fetch the complete documentation index at: https://developers.redo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# redoFunctions

> List the functions the store has deployed to its settings, newest first, with their type, contract and last deploy time. Function steps in developer automations are on `Automation.script` instead.

**Required scopes:** [`functions_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-functions_read)

## Arguments

**after** `String`

Forward pagination cursor — returns functions after it.

**before** `String`

Backward pagination cursor — returns functions before it.

**first** `Int`

Forward pagination: returns the first N functions (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.

**last** `Int`

Backward pagination: returns the last N functions (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.

**orderBy** `[RedoFunctionSortKey](/docs/api-reference/v3/reference/developer/redo-function-sort-key)`

Which key to sort by (defaults to the first key, newest-first). Combine with `reverse` to flip direction.

**reverse** `Boolean`

Reverses the sort direction selected by `orderBy` (or its default).

**targetType** `[RedoFunctionTargetType](/docs/api-reference/v3/reference/developer/redo-function-target-type)`

Only functions attached to this kind of setting.

## Returns

**redoFunctions** `[RedoFunctionConnection!](/docs/api-reference/v3/pagination)` *required*

A paginated list of RedoFunction items.

**fields**

**edges** `[\[RedoFunctionEdge!\]!](/docs/api-reference/v3/pagination)` *required*

The list of edges (each a node plus its pagination `cursor`).

**fields**

**cursor** `String!` *required*

Opaque cursor for this item; pass to `after`/`before` to page from here.

**node** `[RedoFunction!](/docs/api-reference/v3/reference/developer/redo-function)` *required*

The item at this edge.

**fields**

**code** `String!` *required*

The source code of the function's current version.

**contractId** `String!` *required*

The contract the function's current code satisfies: the shape of the input it receives and the output it must return.

**createdAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the function was first deployed.

**deployments** `[RedoFunctionDeploymentConnection!](/docs/api-reference/v3/pagination)` *required*

Every deployment of new code to this function, newest first, with the code each one deployed.

**Requires:** [`functions_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-functions_read)

**fields**

**Arguments**

**after** `String`

Forward pagination cursor — returns deployments after it.

**before** `String`

Backward pagination cursor — returns deployments before it.

**first** `Int`

Forward pagination: returns the first N deployments (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.

**last** `Int`

Backward pagination: returns the last N deployments (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.

**id** `ID!` *required*

The id of this function.

**lastDeployedAt** `[DateTime](/docs/api-reference/v3/reference/common/date-time)`

When new code was last deployed to this function. Null when no deployment is recorded.

**targetId** `String!` *required*

The stable identifier of the setting the function is attached to, such as a rate table's id. To list its runs, filter the developer log with `developerLogEntries(functionRun: { sourceId: <targetId> })`.

**targetType** `[RedoFunctionTargetType!](/docs/api-reference/v3/reference/developer/redo-function-target-type)` *required*

The kind of setting the function is attached to.

**nodes** `[\[RedoFunction!\]!](/docs/api-reference/v3/reference/developer/redo-function)` *required*

The nodes in this page, without the edge/cursor wrapper — a convenience over `edges`.

**fields**

**code** `String!` *required*

The source code of the function's current version.

**contractId** `String!` *required*

The contract the function's current code satisfies: the shape of the input it receives and the output it must return.

**createdAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the function was first deployed.

**deployments** `[RedoFunctionDeploymentConnection!](/docs/api-reference/v3/pagination)` *required*

Every deployment of new code to this function, newest first, with the code each one deployed.

**Requires:** [`functions_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-functions_read)

**fields**

**Arguments**

**after** `String`

Forward pagination cursor — returns deployments after it.

**before** `String`

Backward pagination cursor — returns deployments before it.

**first** `Int`

Forward pagination: returns the first N deployments (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.

**last** `Int`

Backward pagination: returns the last N deployments (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.

**Fields**

**edges** `[\[RedoFunctionDeploymentEdge!\]!](/docs/api-reference/v3/pagination)` *required*

The list of edges (each a node plus its pagination `cursor`).

**nodes** `[\[RedoFunctionDeployment!\]!](/docs/api-reference/v3/reference/developer/redo-function-deployment)` *required*

The nodes in this page, without the edge/cursor wrapper — a convenience over `edges`.

**pageInfo** `[PageInfo!](/docs/api-reference/v3/pagination)` *required*

Pagination metadata for the current page.

**id** `ID!` *required*

The id of this function.

**lastDeployedAt** `[DateTime](/docs/api-reference/v3/reference/common/date-time)`

When new code was last deployed to this function. Null when no deployment is recorded.

**targetId** `String!` *required*

The stable identifier of the setting the function is attached to, such as a rate table's id. To list its runs, filter the developer log with `developerLogEntries(functionRun: { sourceId: <targetId> })`.

**targetType** `[RedoFunctionTargetType!](/docs/api-reference/v3/reference/developer/redo-function-target-type)` *required*

The kind of setting the function is attached to.

**pageInfo** `[PageInfo!](/docs/api-reference/v3/pagination)` *required*

Pagination metadata for the current page.

**fields**

**endCursor** `String`

Cursor of the last edge in this page; pass to `after` to page forward.

**hasNextPage** `Boolean!` *required*

Whether more items exist after this page (drives forward pagination with `first`/`after`).

**hasPreviousPage** `Boolean!` *required*

Whether more items exist before this page (drives backward pagination with `last`/`before`).

**startCursor** `String`

Cursor of the first edge in this page; pass to `before` to page backward.

## Example

```graphql theme={null}
query {
  redoFunctions(after: "...", before: "...", first: 10, last: 10, orderBy: CREATED_AT, reverse: true, targetType: CUSTOMS_LINE_ITEMS) {
    nodes {
      code
      contractId
      createdAt
      id
      lastDeployedAt
      targetId
      targetType
    }
    pageInfo { hasNextPage endCursor }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.