# Sample R script to query GraphQL API

**URL:** <https://community.opentargets.org/t/sample-r-script-to-query-graphql-api/510>\
**Category:** GraphQL API\
**Created:** [17 March 2022 08:08 UTC](https://community.opentargets.org/t/sample-r-script-to-query-graphql-api/510 "2022-03-17T08:08:38Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![irene](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/irene/32/50_2.png) [@irene](https://community.opentargets.org/u/irene)\
**Post date:** [11 August 2023 08:43 UTC](https://community.opentargets.org/t/sample-r-script-to-query-graphql-api/510/5 "2023-08-11T08:43:28Z")

</div>

Hi @Shicheng_Guo,

I am guessing you took this snippet from our documentation. The response is indeed empty because the tractability was not up-to-date with the latest changes - `tractability` no longer has an id.  
This is the correct request:

```auto
  query target($ensemblId: String!){
    target(ensemblId: $ensemblId){
      id
      approvedSymbol
      biotype
      geneticConstraint {
        constraintType
        exp
        obs
        score
        oe
        oeLower
        oeUpper
      }
      tractability {
        label
        modality
        value
      }
    }
  }

```

We have corrected the documentation, and the changes will be shortly available. Thanks for reporting!

---

_[View the full topic](https://community.opentargets.org/t/sample-r-script-to-query-graphql-api/510)._
