GraphQL

Interfaces & Types

These are the GraphQL interfaces and types Wishlist adds. The Queries page shows them in use.

Lists

The ListInterface Interface

The interface implemented by every list. Lists use a single type, List, which also holds the custom fields from your list types’ List Fields layouts. Request those inside a ... on List fragment, as shown in Querying Custom Fields.

As well as the fields below, the interface includes Craft’s standard element fields, such as id, uid, title, status, enabled, siteId, dateCreated and dateUpdated. A list’s title is its own title, which starts as its list type’s name.

{
  wishlists(limit: 1) {
    id
    title
    typeId
    userId
    reference
    default
    items(limit: 5) {
      title
    }
  }
}

typeId

The ID of the list’s list type.

userId

The ID of the user who owns the list, or null for a guest’s list.

reference

The list’s reference, which identifies it in shared list links.

default

Whether the list is its owner’s default list.

items

The items in the list, each as an Item type. It accepts the same arguments as the wishlistItems query, so you can sort, limit or filter a list’s items. The results are always limited to this list, whatever listId you pass.

{
  wishlists(userId: 1) {
    title
    items(orderBy: "dateCreated DESC", limit: 3) {
      title
      element {
        id
      }
    }
  }
}

Items

The ItemInterface Interface

The interface implemented by every item. Items use a single type, Item, which also holds the custom fields from your list types’ Item Fields layouts. Request those inside a ... on Item fragment.

As well as the fields below, the interface includes Craft’s standard element fields, such as id, uid, status, enabled, siteId, dateCreated and dateUpdated.

The title, elementId, elementClass and element fields describe the element the item links to. They return null when the schema can’t read that element, as Linked Element Permissions explains, so check for null before using them.

{
  wishlistItems(listId: 4562) {
    id
    listId
    title
    elementId
    elementClass
    element {
      title
      url
    }
  }
}

title

The title of the element the item links to.

listId

The ID of the list the item belongs to.

elementId

The ID of the element the item links to.

elementClass

The class of the element the item links to, such as craft\elements\Entry.

element

The element the item links to. Use a fragment for its type to request that type’s fields, such as a product’s variants or an entry’s custom fields.

{
  wishlistItems(listId: 4562) {
    element {
      title
      url
      ... on blog_Entry {
        summary
      }
    }
  }
}
Last updated: Nov 13, 2026, 3:15:51 PM