Answers.Body: <p>I know this question is 1.5+ years old but I landed here looking for something similar and think I found the answer: <code>relatedToEntries</code>.
  In the docs: <a href="https://craftcms.com/docs/3.x/graphql.html#relations" rel="nofollow noreferrer">https://craftcms.com/docs/3.x/graphql.html#relations</a></p>
  <p>Something like this (replacing 'attributeHandle' and &quot;valueYouWant&quot;):</p>
  <pre><code>query test {
    entries(section: &quot;vacancies&quot;, relatedToEntries({attributeHandle: &quot;valueYouWant&quot;) {
      title
      ... on vacancies_vacancies_Entry {
        description
        organisation {
          title
          ... on organisations_organisations_Entry {
            organisationType
          }
        }
      }
    }
  }
  </code></pre>
  <p>Works for me. Hope that helps get someone on the right path!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-22T15:49:42.843Z
Answers.LastActivityDate: 2021-10-22T15:49:42.843Z
Answers.UserDisplayName: Kirk Roberts
Body: <p>Lets have this query:</p>
  
  <pre><code>query test {
    entries(section: "vacancies") {
      title
      ... on vacancies_vacancies_Entry {
        description
        organisation {
          title
          ... on organisations_organisations_Entry {
            organisationType
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>Now how would I go about only displaying <strong>vacancies</strong> from an <strong>organisation</strong> that has a specific <strong>organisationType</strong> . I've had a quick read through graphQl docs and couldn't find anything that could help.</p>
  
  <p>I guess I can first query organisations, get their <strong>IDs</strong> and then pass it to <strong>relatedTo</strong> parameter to another query, but that's 2 API requests each time I want to make a query. Is it possible to somehow use one graphQL query as a parameter in another graphQl query? Are there any better solutions to this?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-09T03:38:37.957Z
Comments.Text: Would really like to know this also, as it would be a very common use-case. This is similar to a simple join in SQL, e.g. "select * from x join y on y.xid=x.id and y.type=2".
Comments.UserDisplayName: misteraidan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-09-26T16:59:04.963Z
Comments.Text: Did you ever figure this out? I am hitting the same wall. I need to grab related Matrix blocks, but in order to get those related blocks, I need to send over an entry element or an entry id. I'd rather not have to run two queries every time. Argh.
Comments.UserDisplayName: Jacob Graf
Tags: <relations><relatedto><graphql>
Title: In GraphQL how to query entries where related entry has a specific value
ThreadText: # In GraphQL how to query entries where related entry has a specific value
  
  (Asked by: username_0 on 2020-03-05)
  
  Lets have this query:
  
  ```
  query test {
    entries(section: "vacancies") {
      title
      ... on vacancies_vacancies_Entry {
        description
        organisation {
          title
          ... on organisations_organisations_Entry {
            organisationType
          }
        }
      }
    }
  }
  
  ```
  
  Now how would I go about only displaying **vacancies** from an **organisation** that has a specific **organisationType** . I've had a quick read through graphQl docs and couldn't find anything that could help.
  
  I guess I can first query organisations, get their **IDs** and then pass it to **relatedTo** parameter to another query, but that's 2 API requests each time I want to make a query. Is it possible to somehow use one graphQL query as a parameter in another graphQl query? Are there any better solutions to this?
  
  **Tags:** relations, relatedto, graphql
  
  > **Comments:**
  > **username_1**: Would really like to know this also, as it would be a very common use-case. This is similar to a simple join in SQL, e.g. "select * from x join y on y.xid=x.id and y.type=2".  
  > **username_2**: Did you ever figure this out? I am hitting the same wall. I need to grab related Matrix blocks, but in order to get those related blocks, I need to send over an entry element or an entry id. I'd rather not have to run two queries every time. Argh.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2021-10-22. Score: 2
  
  I know this question is 1.5+ years old but I landed here looking for something similar and think I found the answer: `relatedToEntries`.
  In the docs: <https://craftcms.com/docs/3.x/graphql.html#relations>
  
  Something like this (replacing 'attributeHandle' and "valueYouWant"):
  
  ```
  query test {
    entries(section: "vacancies", relatedToEntries({attributeHandle: "valueYouWant") {
      title
      ... on vacancies_vacancies_Entry {
        description
        organisation {
          title
          ... on organisations_organisations_Entry {
            organisationType
          }
        }
      }
    }
  }
  
  ```
  
  Works for me. Hope that helps get someone on the right path!
  
  
  ---
  
  