#Query Arrays in payload or GraphQL

4 messages · Page 1 of 1 (latest)

native junco
#

I have a object that has a element that is an array and i only want the objects that have a special tag inside that array.
Like this example. Layout is a array and i only want those pages whiche use my blocks a, b or c. Is this possible with the payload where clause or do i need to do a GraphQL Query?

const test = await payload.find({
    collection: 'pages',
    pagination: false,
    where: {
      'layout.blockType': {
        in: ["a", "b", "c"],
      },
    },
  })

If it i not possible with payload how can i define a GraphQL query? The docs seem a bit unfinished or unclear for me.

toxic cloak
earnest citrus
#

does your example not work?