# Query by reverse relationship?

**URL:** <https://forum.builder.io/t/query-by-reverse-relationship/5142>\
**Category:** CMS\
**Created:** [March 11, 2024, 12:34pm UTC](https://forum.builder.io/t/query-by-reverse-relationship/5142 "2024-03-11T12:34:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevenlangbroek](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/stevenlangbroek/32/3481_2.png) [@stevenlangbroek](https://forum.builder.io/u/stevenlangbroek)\
**Post date:** [March 11, 2024, 12:34pm UTC](https://forum.builder.io/t/query-by-reverse-relationship/5142/1 "2024-03-11T12:34:00Z")

</div>

Hey folks! I was wondering if it’s possible to query by reverse relationship, and if so, what the syntax is for that? In my example, I have a “Project” type, which has a relationship to many “Organization” entities. I’d like to pass my query the value of a custom field on the “Organization” data type, and return all Projects that are related to that Organization… In Strapi I would do something like so:

```graphql
query Projects($orgId: String!) {
    privateProjects: portfolioProjects(
      filters: {
        Private: { eq: true }
        organizations: { ClerkID: { eq: $orgId } }
      }
    ) {
      data {
        id
     }
  }

```

---

<div class="post-metadata">

**Author:** ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)\
**Post date:** [March 11, 2024, 2:58pm UTC](https://forum.builder.io/t/query-by-reverse-relationship/5142/2 "2024-03-11T14:58:07Z")

</div>

Hello @stevenlangbroek,

Welcome to the [builder.io](http://builder.io) forum post.

In [Builder.io](http://Builder.io), you can indeed query by reverse relationship using GraphQL. Assuming you have set up the relationships between “Project” and “Organization” entities, and you want to retrieve all projects related to a specific organization based on a custom field value, you would construct your GraphQL query similarly to your example in Strapi.

Here’s how you might structure your query in [Builder.io](http://Builder.io):

```auto
query Projects($orgId: String!) {
  projects(
    limit: 100
    options: {
      query: {
        'content.organization': { $eq: $orgId }
      }
    }
  ) {
    results {
      id
      # Other fields you want to retrieve
    }
  }
}

```

Make sure to adjust field names (`content.organization` ) and IDs (`$orgId` ) based on your actual schema and data structure in [Builder.io](http://Builder.io).

Thanks,
