# studiesAndLeadVariantsForGene query not working

**URL:** https://community.opentargets.org/t/studiesandleadvariantsforgene-query-not-working/833
**Category:** GraphQL API
**Created:** [4 November 2022 13:45 UTC](https://community.opentargets.org/t/studiesandleadvariantsforgene-query-not-working/833 "2022-11-04T13:45:22Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kamalika\_ray](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/kamalika_ray/32/310_2.png) [@kamalika\_ray](https://community.opentargets.org/u/kamalika_ray)
#### Post date: [4 November 2022 13:45 UTC](https://community.opentargets.org/t/studiesandleadvariantsforgene-query-not-working/833/1 "2022-11-04T13:45:22Z")

</div>

Dear OpenTargets team,

I want to retrieve the studies and lead variants associated with a gene. For that, I am using the graphql API to run the function studiesAndLeadVariantsForGene. It is not showing any results.  
I ran the sample query given on the browser as well where studies and lead variants are being retrieved for Jak2; it is giving no results. Could you please help?

Thanks and Regards,  
Kamalika

---

<div class="post-metadata">

### Author: ![dsuveges](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/dsuveges/32/30_2.png) [@dsuveges](https://community.opentargets.org/u/dsuveges)
#### Post date: [4 November 2022 15:12 UTC](https://community.opentargets.org/t/studiesandleadvariantsforgene-query-not-working/833/2 "2022-11-04T15:12:24Z")

</div>

Hi Kamalika,

Welcome to the OpenTargets community portal! Were you using the Ensembl gene identifier to retrieve data (`ENSG00000096968`)? When you say the request returns no result, is it empty, or you get some kind of an error message? Seeing the code you were running would definitely help to troubleshoot.

In the meantime, please take a look at [this graphql request](https://api.genetics.opentargets.org/graphql/browser?query=query%20GenePageQuery(%24geneId%3A%20String!)%20%7B%0A%20%20geneInfo(geneId%3A%20%24geneId)%20%7B%0A%20%20%20%20id%0A%20%20%20%20symbol%0A%20%20%7D%0A%20%20studiesAndLeadVariantsForGeneByL2G(geneId%3A%20%24geneId)%20%7B%0A%20%20%20%20pval%0A%20%20%20%20yProbaModel%0A%20%20%20%20study%20%7B%0A%20%20%20%20%20%20studyId%0A%20%20%20%20%20%20traitReported%0A%20%20%20%20%20%20pubAuthor%0A%20%20%20%20%20%20pubDate%0A%20%20%20%20%20%20pmid%0A%20%20%20%20%20%20nInitial%0A%20%20%20%20%20%20nReplication%0A%20%20%20%20%20%20hasSumstats%0A%20%20%20%20%7D%0A%20%20%20%20variant%20%7B%0A%20%20%20%20%20%20rsId%0A%20%20%20%20%20%20id%0A%20%20%20%20%7D%0A%20%20%20%20odds%20%7B%0A%20%20%20%20%20%20oddsCI%0A%20%20%20%20%20%20oddsCILower%0A%20%20%20%20%20%20oddsCIUpper%0A%20%20%20%20%7D%0A%20%20%20%20beta%20%7B%0A%20%20%20%20%20%20betaCI%0A%20%20%20%20%20%20betaCILower%0A%20%20%20%20%20%20betaCIUpper%0A%20%20%20%20%20%20direction%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A&variables=%7B%0A%20%20%22geneId%22%3A%20%22ENSG00000096968%22%0A%7D), see how it works, might give you some idea to resolve your issue.

Best,  
Daniel

---

<div class="post-metadata">

### Author: ![kamalika\_ray](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/kamalika_ray/32/310_2.png) [@kamalika\_ray](https://community.opentargets.org/u/kamalika_ray)
#### Post date: [4 November 2022 15:27 UTC](https://community.opentargets.org/t/studiesandleadvariantsforgene-query-not-working/833/3 "2022-11-04T15:27:59Z")

</div>

Hi Daniel @dsuveges ,

Thank you for your reply. The query in the link you provided is for studiesAndLeadVariantsForGeneByL2G. Below is the code I am trying:

```auto
query Jak2variants {
  studiesAndLeadVariantsForGene(geneId: "ENSG00000096968") {
    indexVariant {
      id
    }
    study {
      source
      pmid
      traitReported
      pubDate
      pubTitle
      pubAuthor
      hasSumstats
      numAssocLoci
    }
  }
}

```

Thanks,  
Kamalika

---

<div class="post-metadata">

### Author: ![dsuveges](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/dsuveges/32/30_2.png) [@dsuveges](https://community.opentargets.org/u/dsuveges)
#### Post date: [7 November 2022 09:43 UTC](https://community.opentargets.org/t/studiesandleadvariantsforgene-query-not-working/833/4 "2022-11-07T09:43:12Z")

</div>

Hi Kamalika,

You are right, the two endpoints are different and the `studiesAndLeadVariantsForGene` doesn’t give proper response. Interestingly, the API on our developer instance works fine. We have opened and [issue](https://github.com/opentargets/issues/issues/2791) for the bug and our developer team is investigating. I’ll let you know as soon as we know more.

Best,  
Daniel.

---

<div class="post-metadata">

### Author: ![kamalika\_ray](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/kamalika_ray/32/310_2.png) [@kamalika\_ray](https://community.opentargets.org/u/kamalika_ray)
#### Post date: [7 November 2022 10:23 UTC](https://community.opentargets.org/t/studiesandleadvariantsforgene-query-not-working/833/5 "2022-11-07T10:23:21Z")

</div>

Hi Daniel,

Thank you for looking into the issue.

Regards,  
Kamalika
