# Writing a GraphQL query utilizing metadata

**URL:** <https://forum.buildkite.community/t/writing-a-graphql-query-utilizing-metadata/1476>\
**Category:** General\
**Created:** [March 4, 2021, 7:38pm UTC](https://forum.buildkite.community/t/writing-a-graphql-query-utilizing-metadata/1476 "2021-03-04T19:38:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnf](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@johnf](https://forum.buildkite.community/u/johnf)\
**Post date:** [March 4, 2021, 7:38pm UTC](https://forum.buildkite.community/t/writing-a-graphql-query-utilizing-metadata/1476/1 "2021-03-04T19:38:59Z")

</div>

I’m trying to query build status by test channel/agent. Think I’m most of the way there but am unsure of how to filter by metadata tag. It looks like the syntax should be something _like_ this, but this isn’t right:

{  
pipeline(slug: “foobar/continuous-dfu”) {  
builds(state: PASSED, metaData: [“queue=mobile”]) {  
count  
}  
}  
}

Any help appreciated.

Thanks!

---

<div class="post-metadata">

**Author:** ![Jason](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/jason/32/742_2.png) [@Jason](https://forum.buildkite.community/u/Jason)\
**Post date:** [March 4, 2021, 10:31pm UTC](https://forum.buildkite.community/t/writing-a-graphql-query-utilizing-metadata/1476/2 "2021-03-04T22:31:38Z")

</div>

Hey @johnf, good question!

You are almost there, something like this should work:

```
query {
  pipeline(slug: "org/pipeline-slug") {
    builds(state: PASSED, metaData: "queue=default") {
      count
    }
  }
}
```
