# Limiting the number of entities in the response

**URL:** <https://community.opentargets.org/t/limiting-the-number-of-entities-in-the-response/1142>\
**Category:** Data Access\
**Tags:** graphql\
**Created:** [10 July 2023 16:23 UTC](https://community.opentargets.org/t/limiting-the-number-of-entities-in-the-response/1142 "2023-07-10T16:23:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Orlando\_B](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/orlando_b/32/448_2.png) [@Orlando\_B](https://community.opentargets.org/u/Orlando_B)\
**Post date:** [10 July 2023 16:23 UTC](https://community.opentargets.org/t/limiting-the-number-of-entities-in-the-response/1142/1 "2023-07-10T16:23:16Z")

</div>

Hello every one!

I’m using your GraphQL data access point to extract some data. For example, the following code:

```auto
query TargetDiseases {
  target(ensemblId: "ENSG00000157764") {
    id
    approvedSymbol
    associatedDiseases {
      count
      rows {
        disease {
          id
          name
        }
        datasourceScores {
          id
          score
        }
      }
    }
  }
}

```

This query returns 1220 diseases related to this target. How can I limit the number of diseases in the answer, directly from the query?

Thank you !

---

<div class="post-metadata">

**Author:** ![hcornu](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/hcornu/32/716_2.png) [@hcornu](https://community.opentargets.org/u/hcornu)\
**Post date:** [10 July 2023 18:58 UTC](https://community.opentargets.org/t/limiting-the-number-of-entities-in-the-response/1142/2 "2023-07-10T18:58:15Z")

</div>

Hi @Orlando_B, and welcome to the Open Targets Community! 🎉

If you want to limit the number of diseases the query returns, try:

> [@Returning all associations data using the Platform API](https://community.opentargets.org/t/returning-all-associations-data-using-the-platform-api/324#how-do-i-access-associations-data-using-the-open-targets-platform-graphql-api-1):
>
> If I run a targets search with associatedDisease information how can I specify that I want all rows? For example this query says it has 947 associatedDiseases but not all of them are included in the rows: Write your query or mutation here query target\_disease { target(ensemblId: “ENSG00000105974”) { id approvedSymbol approvedName associatedDiseases { count rows { score disease { id name } } } } }
