Skip to content

Commit

Permalink
refactor(graphql-api): reuse index definition in lof curation queries
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyhgrant committed Jun 21, 2024
1 parent 0222e80 commit d70a4d8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions graphql-api/src/queries/lof-curation-result-queries.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
const GNOMAD_V2_LOF_CURATION_RESULTS_INDEX = 'gnomad_v2_lof_curation_results'

// ================================================================================================
// Variant query
// ================================================================================================

export const fetchLofCurationResultsByVariant = async (esClient: any, variantId: any) => {
const response = await esClient.search({
index: 'gnomad_v2_lof_curation_results',
index: GNOMAD_V2_LOF_CURATION_RESULTS_INDEX,
type: '_doc',
body: {
query: {
Expand All @@ -29,7 +31,7 @@ export const fetchLofCurationResultsByVariant = async (esClient: any, variantId:

export const fetchLofCurationResultsByGene = async (esClient: any, gene: any) => {
const response = await esClient.search({
index: 'gnomad_v2_lof_curation_results',
index: GNOMAD_V2_LOF_CURATION_RESULTS_INDEX,
type: '_doc',
size: 1000,
body: {
Expand All @@ -54,7 +56,7 @@ export const fetchLofCurationResultsByGene = async (esClient: any, gene: any) =>

export const fetchLofCurationResultsByRegion = async (esClient: any, region: any) => {
const response = await esClient.search({
index: 'gnomad_v2_lof_curation_results',
index: GNOMAD_V2_LOF_CURATION_RESULTS_INDEX,
type: '_doc',
size: 1000,
body: {
Expand Down

0 comments on commit d70a4d8

Please sign in to comment.