The Casts and Welds collection within Organization queries will soon be changing to:
- Be paginated
- Support more filtering options
These changes will help improve the overall querying experience by reducing load on Anvil’s database as well as make it easier for you to find the exact Casts and Welds you need.
How do these changes affect you?
If you’re currently using the Organization query to fetch Casts and/or Welds, all Casts and/or Welds in your organization are returned by default.
Starting March 4th, 2026, organization.welds and organization.casts will become paginated. At this point you’ll need to specify a limit and offset in order for your query to return specific pages of results.
In the meantime, you can prepare for the upcoming changes by testing out the new query structure with castsPaginated and weldsPaginated. These fields already support the new filters and paginated structure, so you can try them out now. See castPage and weldPage for more details on pagination structure.
While castsPaginated and weldsPaginated will remain available, we recommend migrating to the updated casts and welds queries once they become paginated in March 2026.
How will these new paginated queries work?
castPaginated and weldsPaginated support additional search, sort, and filter options. You’ll be able to search for Casts and Welds by name and status and then further sort results in ascending or descending order.
Since the results are paginated, you’ll want to specify a limit to set the number of items returned per page (max 500) and an offset to determine which page number is returned.
If you don't specify pagination parameters, the default behavior is to return the first 10 items from your organization's entire library of Casts and/or Welds.
Leveraging both filters and specific page limits and numbers make your searches far more efficient.
Default values
When using the new paginated queries, here are the default values that will be applied if you don't specify parameters:
castsPaginated defaults:
- limit: 10 items per page
- offset: 0 (first page)
- orderBy:
name - orderDirection:
asc(alphabetical) - isArchived:
false(returns only non-archived) - isTemplate:
null(returns both templates and non-templates) - isPublished:
null(returns both published and unpublished) - isDraft:
null(returns both draft and non-draft)
weldsPaginated defaults:
- limit: 10 items per page
- offset: 0 (first page)
- orderBy:
updatedAt - orderDirection:
desc(newest first) - isArchived:
false(returns only non-archived) - visibility:
null(returns all visibility states) - isClosed:
null(returns both closed and open) - isDraft:
null(returns both draft and non-draft)
Code examples
Use these examples to get you started.
castsPaginated
query OrganizationWithCastsQuery($organizationSlug: String!, $castsIsTemplate: Boolean, $castsLimit: Int, $castsOffset: Int, $castsQuery: String, $castsOrderBy: String, $castsOrderDirection: String, $castsIsPublished: Boolean, $castsIsDraft: Boolean, $castsIsArchived: Boolean) {
data: organization(organizationSlug: $organizationSlug) {
castsPaginated(
isTemplate: $castsIsTemplate
limit: $castsLimit
offset: $castsOffset
query: $castsQuery
orderBy: $castsOrderBy
orderDirection: $castsOrderDirection
isPublished: $castsIsPublished
isDraft: $castsIsDraft
isArchived: $castsIsArchived
) {
rowCount
pageCount
page
pageSize
items {
id
eid
type
name
title
type
createdAt
updatedAt
publishedAt
isTemplate
archivedAt
hasUnpublishedChanges
}
}
}
}
Variables:
{
"organizationSlug": "organizatino-slug",
"castsLimit": 50,
"castsOffset": 1,
"castsOrderDirection": "desc", // asc
"castsQuery": "your-cast-name",
"castsIsPublished": true,
"castsIsDraft": false,
"castsIsArchived": false,
"castsIsTemplate": true,
"castsOrderBy": "title", // createdAt, updatedAt, publishedAt
}
weldsPaginated
query OrganizationWithWeldsQuery($organizationSlug: String!, $weldsLimit: Int, $weldsOffset: Int, $weldsQuery: String, $name: String, $weldsDateStart: String, $weldsDateEnd: String, $weldsOrderBy: String, $weldsOrderDirection: String, $weldsVisibility: String, $weldsIsClosed: Boolean, $weldsIsArchived: Boolean, $weldsIsDraft: Boolean, $weldsDateFilterBy: String) {
data: organization(organizationSlug: $organizationSlug) {
weldsPaginated(
visibility: $weldsVisibility
limit: $weldsLimit
offset: $weldsOffset
query: $weldsQuery
name: $name
dateStart: $weldsDateStart
dateEnd: $weldsDateEnd
orderBy: $weldsOrderBy
orderDirection: $weldsOrderDirection
isClosed: $weldsIsClosed
isArchived: $weldsIsArchived
isDraft: $weldsIsDraft
dateFilterBy: $weldsDateFilterBy
) {
rowCount
pageCount
pageSize
page
items {
id
eid
slug
name
title
visibility
config
archivedAt
createdAt
updatedAt
expiresAt
publishedAt
publishedSlug
hasUnpublishedChanges
}
}
}
}
Variables:
{
"organizationSlug": "organization-slug",
"weldsLimit": 50,
"weldsOffset": 1,
"weldsQuery": "your-weld-name",
"weldsOrderBy": "name", // createdAt, updatedAt, submissions
"weldsOrderDirection": "desc", // asc
"weldsVisibility": "live", // closed, draft, archived
"weldsIsClosed": false,
"weldsDateStart": "2025-01-01T00:00:00.000Z",
"weldsDateEnd": "2025-01-02T00:00:00.000Z",
"weldsDateFilterBy": "weld.updatedAt",
"weldsIsArchived": false,
"weldsIsDraft": true
}
Timeline Recap
- Fall & Winter 2025:
- Start practicing with
weldsPaginatedandcastsPaginatedto get used to the new pagination and filtering changes - You can continue to use organization.welds and organization.casts queries as is
- Get ahead of the game by updating any automated queries to use weldsPaginated and castsPaginated
- Start practicing with
- March 4th 2026: All queries will use pagination.
- End of 2026: Update your weldsPaginated and castsPaginated queries to use welds and casts with the same structure.
