How do I find the files attached to an item in graphql?

I have this item, or rather subitem (with a file attached):

The file is not in a column, or a status, so I don’t seem to be able to locate it using graphql:

  • How can I find it with graphql?
  • Where am I going wrong?

See the asset_source argument. You need to add that with gallery or all as the default is columns apparently. Note its an enum, not string so no quotes.

{
  items(ids: "123145234") {
    assets(assets_source: gallery) {
      id
      name
    }
  }
}
``

Thanks @codyfrisch thats weird, so all is what I need. :crossed_fingers:

presuming you want gallery and columns. assets also has an argument for a files column that will restrict it to a particular column

1 Like

Regarding this:

assets_source will take values of all, columns or gallery, but not updates.

That’s somewhat weird, but I guess that columns & gallery must somehow be more strongly connected to an item, whereas an update is somehow seen as more of a separate entity.

If there is some logic behind this, I’d love to know.

To get a full list of all assets attached to an item, you’ll therefore need the following:

{
  items(ids: "123145234") {
    assets(assets_source: all) {
      id
      name
    }
    updates {
      assets {
        id
        name
      }
    }
  }
}