Skip to content

Commit

Permalink
add filtering by list of ids to evidence resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
acoffman committed Oct 23, 2024
1 parent cc9fbf4 commit 0270e8e
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/src/app/generated/server.model.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -8652,6 +8652,11 @@ type Query {
"""
id: Int

"""
Filter to evidence matching a list of EIDs
"""
ids: [Int!]

"""
Returns the last _n_ elements from the list.
"""
Expand Down
82 changes: 82 additions & 0 deletions client/src/app/generated/server.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -40045,6 +40045,26 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "ids",
"description": "Filter to evidence matching a list of EIDs",
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "variantId",
"description": "Exact match filtering on the ID of the variant.",
Expand Down Expand Up @@ -40370,6 +40390,43 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "factor",
"description": "Find a single gene by CIViC ID or NCIt ID",
"args": [
{
"name": "id",
"description": null,
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "ncitId",
"description": null,
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"type": {
"kind": "OBJECT",
"name": "Factor",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "factors",
"description": "List and filter factors.",
Expand Down Expand Up @@ -40707,6 +40764,31 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "fusion",
"description": "Find a single gene by CIViC ID",
"args": [
{
"name": "id",
"description": null,
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"type": {
"kind": "OBJECT",
"name": "Fusion",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "fusions",
"description": "List and filter fusions.",
Expand Down
3 changes: 3 additions & 0 deletions server/app/graphql/resolvers/top_level_evidence_items.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def generate_select(field = nil)
option(:id, type: GraphQL::Types::Int, description: 'Exact match filtering on the ID of the evidence item.') do |scope, value|
scope.where("evidence_items.id = ?", value)
end
option(:ids, type: [GraphQL::Types::Int], description: 'Filter to evidence matching a list of EIDs') do |scope, value|
scope.where("evidence_items.id IN (?)", value)
end
option(:variant_id, type: GraphQL::Types::Int, description: 'Exact match filtering on the ID of the variant.') do |scope, value|
scope.joins(molecular_profile: [:variants]).where("variants.id = ?", value)
end
Expand Down

0 comments on commit 0270e8e

Please sign in to comment.