Skip to content

Commit

Permalink
fixup: remove remaining bits of dedicated VA query
Browse files Browse the repository at this point in the history
  • Loading branch information
phildarnowsky-broad committed Jun 3, 2024
1 parent 52958c8 commit f32ef00
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 29 deletions.
29 changes: 2 additions & 27 deletions graphql-api/src/graphql/resolvers/va.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,13 @@ const POPULATION_NAMES: Record<string, string> = {
unk: 'Unknown',
}

const resolveVAQuery = async (_obj: any, _args: any, _ctx: any) => {
return { va: null, vrs: null }
/* const vrsApiUrl = process.env['VRS_API_URL']
const variantId = normalizeVariantId(args.variantId)
const url = `${vrsApiUrl}/${variantId}`
const response = await fetch(url).catch((error: any) => {
throw error
})
const responseData = await response.json()
const va = responseData.map((result: any) => result['gks_va_freq'])
const vrs = responseData.map((result: any) => result['gks_vrs_variant'])
return { va, vrs }
*/
}

const resolveTypeFromTypeField = (obj: any) => {
return `VA${obj.type}`
}

// "VANumber" because "Number" is taken
type VANumber = { type: string; value: number }

type Numberlike = VANumber

type SequenceInterval = {
type: string
start: Numberlike
end: Numberlike
start: VANumber
end: VANumber
}

type SequenceLocation = {
Expand Down Expand Up @@ -412,10 +391,6 @@ export const resolveVACohortAlleleFrequencies = async (
}

const resolvers = {
Query: {
va: resolveVAQuery,
},
VANumberlike: { __resolveType: resolveTypeFromTypeField },
VASequenceInterval: {
// Workaround for bug in some upstream API versions that omit this type in SequenceIntervals
type: (obj: any) => obj.type || 'SequenceInterval',
Expand Down
6 changes: 4 additions & 2 deletions graphql-api/src/graphql/types/query.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ type Query {
dataset: StructuralVariantDatasetId!
): StructuralVariantDetails @cost(value: 1)
variant(variantId: String, rsid: String, dataset: DatasetId!): VariantDetails @cost(value: 1)
copy_number_variant(variantId: String!, dataset: CopyNumberVariantDatasetId!): CopyNumberVariantDetails @cost(value: 1)
copy_number_variant(
variantId: String!
dataset: CopyNumberVariantDatasetId!
): CopyNumberVariantDetails @cost(value: 1)
gene_search(query: String!, reference_genome: ReferenceGenomeId!): [GeneSearchResult!]!
variant_search(query: String!, dataset: DatasetId!): [VariantSearchResult!]!

Expand All @@ -34,6 +37,5 @@ type Query {

short_tandem_repeats(dataset: DatasetId!): [ShortTandemRepeat!]! @cost(value: 10)

va(variantId: String!): VA!
meta: BrowserMetadata!
}

0 comments on commit f32ef00

Please sign in to comment.