GraphQL#

Workflow supports accessing Submission objects via GraphQL. Be sure to read about Craft's GraphQL support (opens new window).

Submissions#

Example#

{
    workflowSubmissions (status: "pending") {
        id
        status

        owner {
            title
        }
    }
}
{
    "data": {
        "workflowSubmissions": [
            {
                "id": "5673",
                "title": "pending",
                "owner": {
                    "title": "My First Blog Post"
                }
            }
        ]
    }
}

The workflowSubmissions query#

This query is used to query for submissions.

ArgumentTypeDescription
id[QueryArgument]Narrows the query results based on the elements’ IDs.
uid[String]Narrows the query results based on the elements’ UIDs.
status[String]Narrows the query results based on the elements’ statuses.
archivedBooleanNarrows the query results to only elements that have been archived.
trashedBooleanNarrows the query results to only elements that have been soft-deleted.
site[String]Determines which site(s) the elements should be queried in. Defaults to the current (requested) site.
siteIdStringDetermines which site(s) the elements should be queried in. Defaults to the current (requested) site.
uniqueBooleanDetermines whether only elements with unique IDs should be returned by the query.
enabledForSiteBooleanNarrows the query results based on whether the elements are enabled in the site they’re being queried in, per the site argument.
title[String]Narrows the query results based on the elements’ titles.
searchStringNarrows the query results to only elements that match a search query.
relatedTo[Int]Narrows the query results to elements that relate to any of the provided element IDs. This argument is ignored, if relatedToAll is also used.
relatedToAll[Int]Narrows the query results to elements that relate to all the provided element IDs. Using this argument will cause relatedTo argument to be ignored.
ref[String]Narrows the query results based on a reference string.
fixedOrderBooleanCauses the query results to be returned in the order specified by the id argument.
inReverseBooleanCauses the query results to be returned in reverse order.
dateCreated[String]Narrows the query results based on the elements’ creation dates.
dateUpdated[String]Narrows the query results based on the elements’ last-updated dates.
offsetIntSets the offset for paginated results.
limitIntSets the limit for paginated results.
orderByStringSets the field the returned elements should be ordered by
ownerId[QueryArgument]Narrows the query results based on the owner element the submission was made on, per the owners’ IDs.

The SubmissionInterface interface#

This is the interface implemented by all submissions.

FieldTypeDescription
idIDThe id of the entity
uidStringThe uid of the entity
_countIntReturn a number of related elements for a field.
enabledBooleanWhether the element is enabled or not.
archivedBooleanWhether the element is archived or not.
siteIdIntThe ID of the site the element is associated with.
searchScoreStringThe element’s search score, if the search parameter was used when querying for the element.
trashedBooleanWhether the element has been soft-deleted or not.
statusStringThe element's status.
dateCreatedDateTimeThe date the element was created.
dateUpdatedDateTimeThe date the element was last updated.
ownerIdIntThe ID of the element that the submission relates to.
ownerElementInterfaceThe element that the submission relates to.

Previous ← Events