From f0a5c7e25d169c5e0353399e05e125c242962430 Mon Sep 17 00:00:00 2001 From: Susanna Kiwala Date: Mon, 28 Oct 2024 14:25:26 -0500 Subject: [PATCH 1/3] New/updated queries to support CIViCpy --- .../phenotypes-table.query.gql | 2 +- .../therapies-table/therapies-table.query.gql | 2 +- .../src/app/generated/civic.apollo-helpers.ts | 90 +- client/src/app/generated/civic.apollo.ts | 160 ++- client/src/app/generated/server.model.graphql | 331 +++++- client/src/app/generated/server.schema.json | 1036 ++++++++++++++++- .../{phenotypes.rb => browse_phenotypes.rb} | 4 +- .../app/graphql/resolvers/browse_therapies.rb | 35 + .../graphql/resolvers/top_level_diseases.rb | 31 + .../graphql/resolvers/top_level_phenotypes.rb | 31 + .../graphql/resolvers/top_level_sources.rb | 21 + .../graphql/resolvers/top_level_therapies.rb | 12 +- server/app/graphql/types/query_type.rb | 8 +- 13 files changed, 1704 insertions(+), 59 deletions(-) rename server/app/graphql/resolvers/{phenotypes.rb => browse_phenotypes.rb} (91%) create mode 100644 server/app/graphql/resolvers/browse_therapies.rb create mode 100644 server/app/graphql/resolvers/top_level_diseases.rb create mode 100644 server/app/graphql/resolvers/top_level_phenotypes.rb create mode 100644 server/app/graphql/resolvers/top_level_sources.rb diff --git a/client/src/app/components/phenotypes/phenotypes-table/phenotypes-table.query.gql b/client/src/app/components/phenotypes/phenotypes-table/phenotypes-table.query.gql index b0025d5c9..f872ae2dc 100644 --- a/client/src/app/components/phenotypes/phenotypes-table/phenotypes-table.query.gql +++ b/client/src/app/components/phenotypes/phenotypes-table/phenotypes-table.query.gql @@ -7,7 +7,7 @@ query PhenotypesBrowse( $hpoId: String $sortBy: PhenotypeSort ) { - phenotypes( + browsePhenotypes( first: $first last: $last before: $before diff --git a/client/src/app/components/therapies/therapies-table/therapies-table.query.gql b/client/src/app/components/therapies/therapies-table/therapies-table.query.gql index f8bc7a0a2..dbe4d9baa 100644 --- a/client/src/app/components/therapies/therapies-table/therapies-table.query.gql +++ b/client/src/app/components/therapies/therapies-table/therapies-table.query.gql @@ -8,7 +8,7 @@ query TherapiesBrowse( $therapyAlias: String, $sortBy: TherapySort ) { - therapies( + browseTherapies( first: $first last: $last before: $before diff --git a/client/src/app/generated/civic.apollo-helpers.ts b/client/src/app/generated/civic.apollo-helpers.ts index 68e1a5561..877180504 100644 --- a/client/src/app/generated/civic.apollo-helpers.ts +++ b/client/src/app/generated/civic.apollo-helpers.ts @@ -834,6 +834,19 @@ export type DiseaseFieldPolicy = { myDiseaseInfo?: FieldPolicy | FieldReadFunction, name?: FieldPolicy | FieldReadFunction }; +export type DiseaseConnectionKeySpecifier = ('edges' | 'nodes' | 'pageCount' | 'pageInfo' | 'totalCount' | DiseaseConnectionKeySpecifier)[]; +export type DiseaseConnectionFieldPolicy = { + edges?: FieldPolicy | FieldReadFunction, + nodes?: FieldPolicy | FieldReadFunction, + pageCount?: FieldPolicy | FieldReadFunction, + pageInfo?: FieldPolicy | FieldReadFunction, + totalCount?: FieldPolicy | FieldReadFunction +}; +export type DiseaseEdgeKeySpecifier = ('cursor' | 'node' | DiseaseEdgeKeySpecifier)[]; +export type DiseaseEdgeFieldPolicy = { + cursor?: FieldPolicy | FieldReadFunction, + node?: FieldPolicy | FieldReadFunction +}; export type DiseasePopoverKeySpecifier = ('assertionCount' | 'deprecated' | 'diseaseAliases' | 'diseaseUrl' | 'displayName' | 'doid' | 'evidenceItemCount' | 'id' | 'link' | 'molecularProfileCount' | 'myDiseaseInfo' | 'name' | DiseasePopoverKeySpecifier)[]; export type DiseasePopoverFieldPolicy = { assertionCount?: FieldPolicy | FieldReadFunction, @@ -1813,6 +1826,19 @@ export type PhenotypeFieldPolicy = { name?: FieldPolicy | FieldReadFunction, url?: FieldPolicy | FieldReadFunction }; +export type PhenotypeConnectionKeySpecifier = ('edges' | 'nodes' | 'pageCount' | 'pageInfo' | 'totalCount' | PhenotypeConnectionKeySpecifier)[]; +export type PhenotypeConnectionFieldPolicy = { + edges?: FieldPolicy | FieldReadFunction, + nodes?: FieldPolicy | FieldReadFunction, + pageCount?: FieldPolicy | FieldReadFunction, + pageInfo?: FieldPolicy | FieldReadFunction, + totalCount?: FieldPolicy | FieldReadFunction +}; +export type PhenotypeEdgeKeySpecifier = ('cursor' | 'node' | PhenotypeEdgeKeySpecifier)[]; +export type PhenotypeEdgeFieldPolicy = { + cursor?: FieldPolicy | FieldReadFunction, + node?: FieldPolicy | FieldReadFunction +}; export type PhenotypePopoverKeySpecifier = ('assertionCount' | 'description' | 'evidenceItemCount' | 'hpoId' | 'id' | 'link' | 'molecularProfileCount' | 'name' | 'url' | PhenotypePopoverKeySpecifier)[]; export type PhenotypePopoverFieldPolicy = { assertionCount?: FieldPolicy | FieldReadFunction, @@ -1825,7 +1851,7 @@ export type PhenotypePopoverFieldPolicy = { name?: FieldPolicy | FieldReadFunction, url?: FieldPolicy | FieldReadFunction }; -export type QueryKeySpecifier = ('acmgCode' | 'acmgCodesTypeahead' | 'activities' | 'activity' | 'assertion' | 'assertions' | 'browseDiseases' | 'browseFeatures' | 'browseMolecularProfiles' | 'browseSources' | 'browseVariantGroups' | 'browseVariants' | 'clingenCode' | 'clingenCodesTypeahead' | 'clinicalTrial' | 'clinicalTrials' | 'comment' | 'comments' | 'contributors' | 'countries' | 'dataReleases' | 'disease' | 'diseasePopover' | 'diseaseTypeahead' | 'entityTypeahead' | 'events' | 'evidenceItem' | 'evidenceItems' | 'factor' | 'factors' | 'feature' | 'featureTypeahead' | 'flag' | 'flags' | 'fusion' | 'fusions' | 'gene' | 'genes' | 'molecularProfile' | 'molecularProfiles' | 'nccnGuideline' | 'nccnGuidelinesTypeahead' | 'notifications' | 'organization' | 'organizationLeaderboards' | 'organizations' | 'phenotype' | 'phenotypePopover' | 'phenotypeTypeahead' | 'phenotypes' | 'previewCommentText' | 'previewMolecularProfileName' | 'remoteCitation' | 'revision' | 'revisions' | 'search' | 'searchByPermalink' | 'searchGenes' | 'source' | 'sourcePopover' | 'sourceSuggestionValues' | 'sourceSuggestions' | 'sourceTypeahead' | 'subscriptionForEntity' | 'therapies' | 'therapy' | 'therapyPopover' | 'therapyTypeahead' | 'timepointStats' | 'user' | 'userLeaderboards' | 'userTypeahead' | 'users' | 'validateRevisionsForAcceptance' | 'variant' | 'variantGroup' | 'variantGroups' | 'variantType' | 'variantTypePopover' | 'variantTypeTypeahead' | 'variantTypes' | 'variants' | 'variantsTypeahead' | 'viewer' | QueryKeySpecifier)[]; +export type QueryKeySpecifier = ('acmgCode' | 'acmgCodesTypeahead' | 'activities' | 'activity' | 'assertion' | 'assertions' | 'browseDiseases' | 'browseFeatures' | 'browseMolecularProfiles' | 'browsePhenotypes' | 'browseSources' | 'browseTherapies' | 'browseVariantGroups' | 'browseVariants' | 'clingenCode' | 'clingenCodesTypeahead' | 'clinicalTrial' | 'clinicalTrials' | 'comment' | 'comments' | 'contributors' | 'countries' | 'dataReleases' | 'disease' | 'diseasePopover' | 'diseaseTypeahead' | 'diseases' | 'entityTypeahead' | 'events' | 'evidenceItem' | 'evidenceItems' | 'factor' | 'factors' | 'feature' | 'featureTypeahead' | 'flag' | 'flags' | 'fusion' | 'fusions' | 'gene' | 'genes' | 'molecularProfile' | 'molecularProfiles' | 'nccnGuideline' | 'nccnGuidelinesTypeahead' | 'notifications' | 'organization' | 'organizationLeaderboards' | 'organizations' | 'phenotype' | 'phenotypePopover' | 'phenotypeTypeahead' | 'phenotypes' | 'previewCommentText' | 'previewMolecularProfileName' | 'remoteCitation' | 'revision' | 'revisions' | 'search' | 'searchByPermalink' | 'searchGenes' | 'source' | 'sourcePopover' | 'sourceSuggestionValues' | 'sourceSuggestions' | 'sourceTypeahead' | 'sources' | 'subscriptionForEntity' | 'therapies' | 'therapy' | 'therapyPopover' | 'therapyTypeahead' | 'timepointStats' | 'user' | 'userLeaderboards' | 'userTypeahead' | 'users' | 'validateRevisionsForAcceptance' | 'variant' | 'variantGroup' | 'variantGroups' | 'variantType' | 'variantTypePopover' | 'variantTypeTypeahead' | 'variantTypes' | 'variants' | 'variantsTypeahead' | 'viewer' | QueryKeySpecifier)[]; export type QueryFieldPolicy = { acmgCode?: FieldPolicy | FieldReadFunction, acmgCodesTypeahead?: FieldPolicy | FieldReadFunction, @@ -1836,7 +1862,9 @@ export type QueryFieldPolicy = { browseDiseases?: FieldPolicy | FieldReadFunction, browseFeatures?: FieldPolicy | FieldReadFunction, browseMolecularProfiles?: FieldPolicy | FieldReadFunction, + browsePhenotypes?: FieldPolicy | FieldReadFunction, browseSources?: FieldPolicy | FieldReadFunction, + browseTherapies?: FieldPolicy | FieldReadFunction, browseVariantGroups?: FieldPolicy | FieldReadFunction, browseVariants?: FieldPolicy | FieldReadFunction, clingenCode?: FieldPolicy | FieldReadFunction, @@ -1851,6 +1879,7 @@ export type QueryFieldPolicy = { disease?: FieldPolicy | FieldReadFunction, diseasePopover?: FieldPolicy | FieldReadFunction, diseaseTypeahead?: FieldPolicy | FieldReadFunction, + diseases?: FieldPolicy | FieldReadFunction, entityTypeahead?: FieldPolicy | FieldReadFunction, events?: FieldPolicy | FieldReadFunction, evidenceItem?: FieldPolicy | FieldReadFunction, @@ -1890,6 +1919,7 @@ export type QueryFieldPolicy = { sourceSuggestionValues?: FieldPolicy | FieldReadFunction, sourceSuggestions?: FieldPolicy | FieldReadFunction, sourceTypeahead?: FieldPolicy | FieldReadFunction, + sources?: FieldPolicy | FieldReadFunction, subscriptionForEntity?: FieldPolicy | FieldReadFunction, therapies?: FieldPolicy | FieldReadFunction, therapy?: FieldPolicy | FieldReadFunction, @@ -2062,6 +2092,19 @@ export type SourceFieldPolicy = { sourceUrl?: FieldPolicy | FieldReadFunction, title?: FieldPolicy | FieldReadFunction }; +export type SourceConnectionKeySpecifier = ('edges' | 'nodes' | 'pageCount' | 'pageInfo' | 'totalCount' | SourceConnectionKeySpecifier)[]; +export type SourceConnectionFieldPolicy = { + edges?: FieldPolicy | FieldReadFunction, + nodes?: FieldPolicy | FieldReadFunction, + pageCount?: FieldPolicy | FieldReadFunction, + pageInfo?: FieldPolicy | FieldReadFunction, + totalCount?: FieldPolicy | FieldReadFunction +}; +export type SourceEdgeKeySpecifier = ('cursor' | 'node' | SourceEdgeKeySpecifier)[]; +export type SourceEdgeFieldPolicy = { + cursor?: FieldPolicy | FieldReadFunction, + node?: FieldPolicy | FieldReadFunction +}; export type SourcePopoverKeySpecifier = ('abstract' | 'ascoAbstractId' | 'authorString' | 'citation' | 'citationId' | 'clinicalTrials' | 'comments' | 'deprecated' | 'displayType' | 'events' | 'evidenceItemCount' | 'fullJournalTitle' | 'fullyCurated' | 'id' | 'journal' | 'lastCommentEvent' | 'link' | 'name' | 'openAccess' | 'pmcId' | 'publicationDate' | 'publicationDay' | 'publicationMonth' | 'publicationYear' | 'retracted' | 'retractionDate' | 'retractionNature' | 'retractionReasons' | 'sourceType' | 'sourceUrl' | 'title' | SourcePopoverKeySpecifier)[]; export type SourcePopoverFieldPolicy = { abstract?: FieldPolicy | FieldReadFunction, @@ -2308,6 +2351,19 @@ export type TherapyFieldPolicy = { therapyAliases?: FieldPolicy | FieldReadFunction, therapyUrl?: FieldPolicy | FieldReadFunction }; +export type TherapyConnectionKeySpecifier = ('edges' | 'nodes' | 'pageCount' | 'pageInfo' | 'totalCount' | TherapyConnectionKeySpecifier)[]; +export type TherapyConnectionFieldPolicy = { + edges?: FieldPolicy | FieldReadFunction, + nodes?: FieldPolicy | FieldReadFunction, + pageCount?: FieldPolicy | FieldReadFunction, + pageInfo?: FieldPolicy | FieldReadFunction, + totalCount?: FieldPolicy | FieldReadFunction +}; +export type TherapyEdgeKeySpecifier = ('cursor' | 'node' | TherapyEdgeKeySpecifier)[]; +export type TherapyEdgeFieldPolicy = { + cursor?: FieldPolicy | FieldReadFunction, + node?: FieldPolicy | FieldReadFunction +}; export type TherapyPopoverKeySpecifier = ('assertionCount' | 'deprecated' | 'evidenceItemCount' | 'id' | 'link' | 'molecularProfileCount' | 'myChemInfo' | 'name' | 'ncitId' | 'therapyAliases' | 'therapyUrl' | TherapyPopoverKeySpecifier)[]; export type TherapyPopoverFieldPolicy = { assertionCount?: FieldPolicy | FieldReadFunction, @@ -2904,6 +2960,14 @@ export type StrictTypedTypePolicies = { keyFields?: false | DiseaseKeySpecifier | (() => undefined | DiseaseKeySpecifier), fields?: DiseaseFieldPolicy, }, + DiseaseConnection?: Omit & { + keyFields?: false | DiseaseConnectionKeySpecifier | (() => undefined | DiseaseConnectionKeySpecifier), + fields?: DiseaseConnectionFieldPolicy, + }, + DiseaseEdge?: Omit & { + keyFields?: false | DiseaseEdgeKeySpecifier | (() => undefined | DiseaseEdgeKeySpecifier), + fields?: DiseaseEdgeFieldPolicy, + }, DiseasePopover?: Omit & { keyFields?: false | DiseasePopoverKeySpecifier | (() => undefined | DiseasePopoverKeySpecifier), fields?: DiseasePopoverFieldPolicy, @@ -3236,6 +3300,14 @@ export type StrictTypedTypePolicies = { keyFields?: false | PhenotypeKeySpecifier | (() => undefined | PhenotypeKeySpecifier), fields?: PhenotypeFieldPolicy, }, + PhenotypeConnection?: Omit & { + keyFields?: false | PhenotypeConnectionKeySpecifier | (() => undefined | PhenotypeConnectionKeySpecifier), + fields?: PhenotypeConnectionFieldPolicy, + }, + PhenotypeEdge?: Omit & { + keyFields?: false | PhenotypeEdgeKeySpecifier | (() => undefined | PhenotypeEdgeKeySpecifier), + fields?: PhenotypeEdgeFieldPolicy, + }, PhenotypePopover?: Omit & { keyFields?: false | PhenotypePopoverKeySpecifier | (() => undefined | PhenotypePopoverKeySpecifier), fields?: PhenotypePopoverFieldPolicy, @@ -3300,6 +3372,14 @@ export type StrictTypedTypePolicies = { keyFields?: false | SourceKeySpecifier | (() => undefined | SourceKeySpecifier), fields?: SourceFieldPolicy, }, + SourceConnection?: Omit & { + keyFields?: false | SourceConnectionKeySpecifier | (() => undefined | SourceConnectionKeySpecifier), + fields?: SourceConnectionFieldPolicy, + }, + SourceEdge?: Omit & { + keyFields?: false | SourceEdgeKeySpecifier | (() => undefined | SourceEdgeKeySpecifier), + fields?: SourceEdgeFieldPolicy, + }, SourcePopover?: Omit & { keyFields?: false | SourcePopoverKeySpecifier | (() => undefined | SourcePopoverKeySpecifier), fields?: SourcePopoverFieldPolicy, @@ -3416,6 +3496,14 @@ export type StrictTypedTypePolicies = { keyFields?: false | TherapyKeySpecifier | (() => undefined | TherapyKeySpecifier), fields?: TherapyFieldPolicy, }, + TherapyConnection?: Omit & { + keyFields?: false | TherapyConnectionKeySpecifier | (() => undefined | TherapyConnectionKeySpecifier), + fields?: TherapyConnectionFieldPolicy, + }, + TherapyEdge?: Omit & { + keyFields?: false | TherapyEdgeKeySpecifier | (() => undefined | TherapyEdgeKeySpecifier), + fields?: TherapyEdgeFieldPolicy, + }, TherapyPopover?: Omit & { keyFields?: false | TherapyPopoverKeySpecifier | (() => undefined | TherapyPopoverKeySpecifier), fields?: TherapyPopoverFieldPolicy, diff --git a/client/src/app/generated/civic.apollo.ts b/client/src/app/generated/civic.apollo.ts index 8cb50b447..df3b36cc8 100644 --- a/client/src/app/generated/civic.apollo.ts +++ b/client/src/app/generated/civic.apollo.ts @@ -1752,6 +1752,30 @@ export type Disease = { name: Scalars['String']['output']; }; +/** The connection type for Disease. */ +export type DiseaseConnection = { + __typename: 'DiseaseConnection'; + /** A list of edges. */ + edges: Array; + /** A list of nodes. */ + nodes: Array; + /** Total number of pages, based on filtered count and pagesize. */ + pageCount: Scalars['Int']['output']; + /** Information to aid in pagination. */ + pageInfo: PageInfo; + /** The total number of records in this filtered collection. */ + totalCount: Scalars['Int']['output']; +}; + +/** An edge in a connection. */ +export type DiseaseEdge = { + __typename: 'DiseaseEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']['output']; + /** The item at the end of the edge. */ + node?: Maybe; +}; + export type DiseasePopover = { __typename: 'DiseasePopover'; assertionCount: Scalars['Int']['output']; @@ -4718,6 +4742,30 @@ export type Phenotype = { url: Scalars['String']['output']; }; +/** The connection type for Phenotype. */ +export type PhenotypeConnection = { + __typename: 'PhenotypeConnection'; + /** A list of edges. */ + edges: Array; + /** A list of nodes. */ + nodes: Array; + /** Total number of pages, based on filtered count and pagesize. */ + pageCount: Scalars['Int']['output']; + /** Information to aid in pagination. */ + pageInfo: PageInfo; + /** The total number of records in this filtered collection. */ + totalCount: Scalars['Int']['output']; +}; + +/** An edge in a connection. */ +export type PhenotypeEdge = { + __typename: 'PhenotypeEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']['output']; + /** The item at the end of the edge. */ + node?: Maybe; +}; + export type PhenotypePopover = { __typename: 'PhenotypePopover'; assertionCount: Scalars['Int']['output']; @@ -4762,7 +4810,9 @@ export type Query = { browseDiseases: BrowseDiseaseConnection; browseFeatures: BrowseFeatureConnection; browseMolecularProfiles: BrowseMolecularProfileConnection; + browsePhenotypes: BrowsePhenotypeConnection; browseSources: BrowseSourceConnection; + browseTherapies: BrowseTherapyConnection; browseVariantGroups: BrowseVariantGroupConnection; browseVariants: BrowseVariantConnection; /** Find a ClinGen code by CIViC ID */ @@ -4787,6 +4837,7 @@ export type Query = { diseasePopover?: Maybe; /** Retrieve disease typeahead fields for a search term. */ diseaseTypeahead: Array; + diseases: DiseaseConnection; /** Retrieve entity type typeahead fields for a entity mention search term. */ entityTypeahead: Array; /** List and filter events for an object */ @@ -4837,7 +4888,7 @@ export type Query = { /** Retrieve phenotype typeahead fields for a search term. */ phenotypeTypeahead: Array; /** List and filter Phenotypes from the Human Phenotype Ontology. */ - phenotypes: BrowsePhenotypeConnection; + phenotypes: PhenotypeConnection; previewCommentText: Array; previewMolecularProfileName: MolecularProfileNamePreview; /** Check to see if a citation ID for a source not already in CIViC exists in an external database. */ @@ -4858,10 +4909,12 @@ export type Query = { sourceSuggestions: SourceSuggestionConnection; /** Provide suggestions for sources based on a partial citation ID */ sourceTypeahead: Array; + /** List and filter genes. */ + sources: SourceConnection; /** Get the active subscription for the entity and logged in user, if any */ subscriptionForEntity?: Maybe; /** List and filter Therapies from the NCI Thesaurus. */ - therapies: BrowseTherapyConnection; + therapies: TherapyConnection; /** Find a therapy by CIViC ID */ therapy?: Maybe; /** Retrieve popover fields for a specific therapy. */ @@ -5008,6 +5061,18 @@ export type QueryBrowseMolecularProfilesArgs = { }; +export type QueryBrowsePhenotypesArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + hpoId?: InputMaybe; + id?: InputMaybe; + last?: InputMaybe; + name?: InputMaybe; + sortBy?: InputMaybe; +}; + + export type QueryBrowseSourcesArgs = { after?: InputMaybe; author?: InputMaybe; @@ -5026,6 +5091,19 @@ export type QueryBrowseSourcesArgs = { }; +export type QueryBrowseTherapiesArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + id?: InputMaybe; + last?: InputMaybe; + name?: InputMaybe; + ncitId?: InputMaybe; + sortBy?: InputMaybe; + therapyAlias?: InputMaybe; +}; + + export type QueryBrowseVariantGroupsArgs = { after?: InputMaybe; before?: InputMaybe; @@ -5123,6 +5201,17 @@ export type QueryDiseaseTypeaheadArgs = { }; +export type QueryDiseasesArgs = { + after?: InputMaybe; + before?: InputMaybe; + doid?: InputMaybe; + first?: InputMaybe; + id?: InputMaybe; + last?: InputMaybe; + name?: InputMaybe; +}; + + export type QueryEntityTypeaheadArgs = { queryTerm: Scalars['String']['input']; }; @@ -5339,7 +5428,6 @@ export type QueryPhenotypesArgs = { id?: InputMaybe; last?: InputMaybe; name?: InputMaybe; - sortBy?: InputMaybe; }; @@ -5439,6 +5527,15 @@ export type QuerySourceTypeaheadArgs = { }; +export type QuerySourcesArgs = { + after?: InputMaybe; + before?: InputMaybe; + citationId?: InputMaybe>; + first?: InputMaybe; + last?: InputMaybe; +}; + + export type QuerySubscriptionForEntityArgs = { subscribable: SubscribableInput; }; @@ -5452,7 +5549,6 @@ export type QueryTherapiesArgs = { last?: InputMaybe; name?: InputMaybe; ncitId?: InputMaybe; - sortBy?: InputMaybe; therapyAlias?: InputMaybe; }; @@ -5896,6 +5992,30 @@ export type SourceEventsArgs = { sortBy?: InputMaybe; }; +/** The connection type for Source. */ +export type SourceConnection = { + __typename: 'SourceConnection'; + /** A list of edges. */ + edges: Array; + /** A list of nodes. */ + nodes: Array; + /** Total number of pages, based on filtered count and pagesize. */ + pageCount: Scalars['Int']['output']; + /** Information to aid in pagination. */ + pageInfo: PageInfo; + /** The total number of records in this filtered collection. */ + totalCount: Scalars['Int']['output']; +}; + +/** An edge in a connection. */ +export type SourceEdge = { + __typename: 'SourceEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']['output']; + /** The item at the end of the edge. */ + node?: Maybe; +}; + export type SourcePopover = Commentable & EventSubject & { __typename: 'SourcePopover'; abstract?: Maybe; @@ -6754,6 +6874,30 @@ export type Therapy = { therapyUrl?: Maybe; }; +/** The connection type for Therapy. */ +export type TherapyConnection = { + __typename: 'TherapyConnection'; + /** A list of edges. */ + edges: Array; + /** A list of nodes. */ + nodes: Array; + /** Total number of pages, based on filtered count and pagesize. */ + pageCount: Scalars['Int']['output']; + /** Information to aid in pagination. */ + pageInfo: PageInfo; + /** The total number of records in this filtered collection. */ + totalCount: Scalars['Int']['output']; +}; + +/** An edge in a connection. */ +export type TherapyEdge = { + __typename: 'TherapyEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']['output']; + /** The item at the end of the edge. */ + node?: Maybe; +}; + export enum TherapyInteraction { Combination = 'COMBINATION', Sequential = 'SEQUENTIAL', @@ -8222,7 +8366,7 @@ export type PhenotypesBrowseQueryVariables = Exact<{ }>; -export type PhenotypesBrowseQuery = { __typename: 'Query', phenotypes: { __typename: 'BrowsePhenotypeConnection', totalCount: number, filteredCount: number, pageInfo: { __typename: 'PageInfo', hasNextPage: boolean, hasPreviousPage: boolean, startCursor?: string | undefined, endCursor?: string | undefined }, edges: Array<{ __typename: 'BrowsePhenotypeEdge', cursor: string, node?: { __typename: 'BrowsePhenotype', id: number, name: string, hpoId: string, url: string, assertionCount: number, evidenceCount: number, link: string } | undefined }> } }; +export type PhenotypesBrowseQuery = { __typename: 'Query', browsePhenotypes: { __typename: 'BrowsePhenotypeConnection', totalCount: number, filteredCount: number, pageInfo: { __typename: 'PageInfo', hasNextPage: boolean, hasPreviousPage: boolean, startCursor?: string | undefined, endCursor?: string | undefined }, edges: Array<{ __typename: 'BrowsePhenotypeEdge', cursor: string, node?: { __typename: 'BrowsePhenotype', id: number, name: string, hpoId: string, url: string, assertionCount: number, evidenceCount: number, link: string } | undefined }> } }; export type PhenotypeBrowseTableRowFieldsFragment = { __typename: 'BrowsePhenotype', id: number, name: string, hpoId: string, url: string, assertionCount: number, evidenceCount: number, link: string }; @@ -8396,7 +8540,7 @@ export type TherapiesBrowseQueryVariables = Exact<{ }>; -export type TherapiesBrowseQuery = { __typename: 'Query', therapies: { __typename: 'BrowseTherapyConnection', totalCount: number, filteredCount: number, pageInfo: { __typename: 'PageInfo', hasNextPage: boolean, hasPreviousPage: boolean, startCursor?: string | undefined, endCursor?: string | undefined }, edges: Array<{ __typename: 'BrowseTherapyEdge', cursor: string, node?: { __typename: 'BrowseTherapy', id: number, name: string, ncitId?: string | undefined, therapyUrl?: string | undefined, assertionCount: number, evidenceCount: number, link: string, deprecated: boolean, therapyAliases?: Array | undefined } | undefined }> } }; +export type TherapiesBrowseQuery = { __typename: 'Query', browseTherapies: { __typename: 'BrowseTherapyConnection', totalCount: number, filteredCount: number, pageInfo: { __typename: 'PageInfo', hasNextPage: boolean, hasPreviousPage: boolean, startCursor?: string | undefined, endCursor?: string | undefined }, edges: Array<{ __typename: 'BrowseTherapyEdge', cursor: string, node?: { __typename: 'BrowseTherapy', id: number, name: string, ncitId?: string | undefined, therapyUrl?: string | undefined, assertionCount: number, evidenceCount: number, link: string, deprecated: boolean, therapyAliases?: Array | undefined } | undefined }> } }; export type TherapyBrowseTableRowFieldsFragment = { __typename: 'BrowseTherapy', id: number, name: string, ncitId?: string | undefined, therapyUrl?: string | undefined, assertionCount: number, evidenceCount: number, link: string, deprecated: boolean, therapyAliases?: Array | undefined }; @@ -14523,7 +14667,7 @@ export const PhenotypePopoverDocument = gql` } export const PhenotypesBrowseDocument = gql` query PhenotypesBrowse($first: Int, $last: Int, $before: String, $after: String, $name: String, $hpoId: String, $sortBy: PhenotypeSort) { - phenotypes( + browsePhenotypes( first: $first last: $last before: $before @@ -14990,7 +15134,7 @@ export const TherapyPopoverDocument = gql` } export const TherapiesBrowseDocument = gql` query TherapiesBrowse($first: Int, $last: Int, $before: String, $after: String, $name: String, $ncitId: String, $therapyAlias: String, $sortBy: TherapySort) { - therapies( + browseTherapies( first: $first last: $last before: $before diff --git a/client/src/app/generated/server.model.graphql b/client/src/app/generated/server.model.graphql index 78792005f..3c161171b 100644 --- a/client/src/app/generated/server.model.graphql +++ b/client/src/app/generated/server.model.graphql @@ -2706,6 +2706,51 @@ type Disease { name: String! } +""" +The connection type for Disease. +""" +type DiseaseConnection { + """ + A list of edges. + """ + edges: [DiseaseEdge!]! + + """ + A list of nodes. + """ + nodes: [Disease!]! + + """ + Total number of pages, based on filtered count and pagesize. + """ + pageCount: Int! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + The total number of records in this filtered collection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type DiseaseEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Disease +} + type DiseasePopover { assertionCount: Int! deprecated: Boolean! @@ -8001,6 +8046,51 @@ type Phenotype { url: String! } +""" +The connection type for Phenotype. +""" +type PhenotypeConnection { + """ + A list of edges. + """ + edges: [PhenotypeEdge!]! + + """ + A list of nodes. + """ + nodes: [Phenotype!]! + + """ + Total number of pages, based on filtered count and pagesize. + """ + pageCount: Int! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + The total number of records in this filtered collection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type PhenotypeEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Phenotype +} + type PhenotypePopover { assertionCount: Int! description: String @@ -8301,6 +8391,47 @@ type Query { variantId: Int variantName: String ): BrowseMolecularProfileConnection! + browsePhenotypes( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Limit to phenotypes with a specific HPO ID + """ + hpoId: String + + """ + Filter Phenotype on internal CIViC id + """ + id: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Wildcard match on phenotype name (class) + """ + name: String + + """ + Sort order for the phenotypes. Defaults to the highest evidence item count. + """ + sortBy: PhenotypeSort + ): BrowsePhenotypeConnection! browseSources( """ Returns the elements in the list that come after the specified cursor. @@ -8332,6 +8463,48 @@ type Query { sourceType: SourceSource year: Int ): BrowseSourceConnection! + browseTherapies( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Filter on a therapy's internal CIViC id + """ + id: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Wildcard match on therapy name + """ + name: String + + """ + Limit to therapies with a specific NCIT ID + """ + ncitId: String + + """ + Sort order for the therapies. Defaults to the highest evidence item count. + """ + sortBy: TherapySort + therapyAlias: String + ): BrowseTherapyConnection! browseVariantGroups( """ Returns the elements in the list that come after the specified cursor. @@ -8536,6 +8709,30 @@ type Query { Retrieve disease typeahead fields for a search term. """ diseaseTypeahead(queryTerm: String!): [Disease!]! + diseases( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + doid: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + id: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + name: String + ): DiseaseConnection! """ Retrieve entity type typeahead fields for a entity mention search term. @@ -9115,12 +9312,7 @@ type Query { Wildcard match on phenotype name (class) """ name: String - - """ - Sort order for the phenotypes. Defaults to the highest evidence item count. - """ - sortBy: PhenotypeSort - ): BrowsePhenotypeConnection! + ): PhenotypeConnection! previewCommentText(commentText: String!): [CommentBodySegment!]! previewMolecularProfileName(structure: MolecularProfileComponentInput): MolecularProfileNamePreview! @@ -9264,6 +9456,36 @@ type Query { """ sourceTypeahead(citationId: String!, sourceType: SourceSource!): [Source!]! + """ + List and filter genes. + """ + sources( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + List of citation IDs to return results for + """ + citationId: [String!] + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): SourceConnection! + """ Get the active subscription for the entity and logged in user, if any """ @@ -9307,13 +9529,8 @@ type Query { Limit to therapies with a specific NCIT ID """ ncitId: String - - """ - Sort order for the therapies. Defaults to the highest evidence item count. - """ - sortBy: TherapySort therapyAlias: String - ): BrowseTherapyConnection! + ): TherapyConnection! """ Find a therapy by CIViC ID @@ -10084,6 +10301,51 @@ type Source implements Commentable & EventSubject { title: String } +""" +The connection type for Source. +""" +type SourceConnection { + """ + A list of edges. + """ + edges: [SourceEdge!]! + + """ + A list of nodes. + """ + nodes: [Source!]! + + """ + Total number of pages, based on filtered count and pagesize. + """ + pageCount: Int! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + The total number of records in this filtered collection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type SourceEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Source +} + type SourcePopover implements Commentable & EventSubject { abstract: String ascoAbstractId: Int @@ -11350,6 +11612,51 @@ type Therapy { therapyUrl: String } +""" +The connection type for Therapy. +""" +type TherapyConnection { + """ + A list of edges. + """ + edges: [TherapyEdge!]! + + """ + A list of nodes. + """ + nodes: [Therapy!]! + + """ + Total number of pages, based on filtered count and pagesize. + """ + pageCount: Int! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + The total number of records in this filtered collection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type TherapyEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Therapy +} + enum TherapyInteraction { COMBINATION SEQUENTIAL diff --git a/client/src/app/generated/server.schema.json b/client/src/app/generated/server.schema.json index 4966fe882..5bfce0c4f 100644 --- a/client/src/app/generated/server.schema.json +++ b/client/src/app/generated/server.schema.json @@ -13932,6 +13932,152 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "DiseaseConnection", + "description": "The connection type for Disease.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "DiseaseEdge", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Disease", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageCount", + "description": "Total number of pages, based on filtered count and pagesize.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "The total number of records in this filtered collection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DiseaseEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Disease", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "DiseasePopover", @@ -37418,6 +37564,152 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "PhenotypeConnection", + "description": "The connection type for Phenotype.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PhenotypeEdge", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Phenotype", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageCount", + "description": "Total number of pages, based on filtered count and pagesize.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "The total number of records in this filtered collection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PhenotypeEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Phenotype", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "PhenotypePopover", @@ -38757,6 +39049,119 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "browsePhenotypes", + "description": null, + "args": [ + { + "name": "hpoId", + "description": "Limit to phenotypes with a specific HPO ID", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "Filter Phenotype on internal CIViC id", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "Wildcard match on phenotype name (class)", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sortBy", + "description": "Sort order for the phenotypes. Defaults to the highest evidence item count.", + "type": { + "kind": "INPUT_OBJECT", + "name": "PhenotypeSort", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "BrowsePhenotypeConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "browseSources", "description": null, @@ -38942,6 +39347,131 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "browseTherapies", + "description": null, + "args": [ + { + "name": "ncitId", + "description": "Limit to therapies with a specific NCIT ID", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "therapyAlias", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "Filter on a therapy's internal CIViC id", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "Wildcard match on therapy name", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sortBy", + "description": "Sort order for the therapies. Defaults to the highest evidence item count.", + "type": { + "kind": "INPUT_OBJECT", + "name": "TherapySort", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "BrowseTherapyConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "browseVariantGroups", "description": null, @@ -39810,6 +40340,107 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "diseases", + "description": null, + "args": [ + { + "name": "id", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "doid", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "DiseaseConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "entityTypeahead", "description": "Retrieve entity type typeahead fields for a entity mention search term.", @@ -41718,18 +42349,6 @@ "isDeprecated": false, "deprecationReason": null }, - { - "name": "sortBy", - "description": "Sort order for the phenotypes. Defaults to the highest evidence item count.", - "type": { - "kind": "INPUT_OBJECT", - "name": "PhenotypeSort", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "after", "description": "Returns the elements in the list that come after the specified cursor.", @@ -41784,7 +42403,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "BrowsePhenotypeConnection", + "name": "PhenotypeConnection", "ofType": null } }, @@ -42600,6 +43219,91 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "sources", + "description": "List and filter genes.", + "args": [ + { + "name": "citationId", + "description": "List of citation IDs to return results for", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SourceConnection", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "subscriptionForEntity", "description": "Get the active subscription for the entity and logged in user, if any", @@ -42681,18 +43385,6 @@ "isDeprecated": false, "deprecationReason": null }, - { - "name": "sortBy", - "description": "Sort order for the therapies. Defaults to the highest evidence item count.", - "type": { - "kind": "INPUT_OBJECT", - "name": "TherapySort", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "after", "description": "Returns the elements in the list that come after the specified cursor.", @@ -42747,7 +43439,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "BrowseTherapyConnection", + "name": "TherapyConnection", "ofType": null } }, @@ -46437,6 +47129,152 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "SourceConnection", + "description": "The connection type for Source.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SourceEdge", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Source", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageCount", + "description": "Total number of pages, based on filtered count and pagesize.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "The total number of records in this filtered collection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SourceEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Source", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "SourcePopover", @@ -51433,6 +52271,152 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "TherapyConnection", + "description": "The connection type for Therapy.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "TherapyEdge", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Therapy", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageCount", + "description": "Total number of pages, based on filtered count and pagesize.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "The total number of records in this filtered collection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "TherapyEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Therapy", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "ENUM", "name": "TherapyInteraction", diff --git a/server/app/graphql/resolvers/phenotypes.rb b/server/app/graphql/resolvers/browse_phenotypes.rb similarity index 91% rename from server/app/graphql/resolvers/phenotypes.rb rename to server/app/graphql/resolvers/browse_phenotypes.rb index 06d42e835..b4a2b0acc 100644 --- a/server/app/graphql/resolvers/phenotypes.rb +++ b/server/app/graphql/resolvers/browse_phenotypes.rb @@ -1,13 +1,11 @@ require 'search_object' require 'search_object/plugin/graphql' -class Resolvers::Phenotypes < GraphQL::Schema::Resolver +class Resolvers::BrowsePhenotypes < GraphQL::Schema::Resolver include SearchObject.module(:graphql) type Types::BrowseTables::BrowsePhenotypeType.connection_type, null: false - description 'List and filter Phenotypes from the Human Phenotype Ontology.' - scope do Phenotype.select('phenotypes.id, phenotypes.hpo_class, phenotypes.hpo_id, count(distinct(assertions.id)) as assertion_count, count(distinct(evidence_items.id)) as evidence_count') .left_outer_joins(:assertions) diff --git a/server/app/graphql/resolvers/browse_therapies.rb b/server/app/graphql/resolvers/browse_therapies.rb new file mode 100644 index 000000000..d6175a793 --- /dev/null +++ b/server/app/graphql/resolvers/browse_therapies.rb @@ -0,0 +1,35 @@ +require 'search_object' +require 'search_object/plugin/graphql' + +class Resolvers::BrowseTherapies < GraphQL::Schema::Resolver + include SearchObject.module(:graphql) + include Resolvers::Shared::SearchHelpers + + type Types::BrowseTables::BrowseTherapyType.connection_type, null: false + + scope { MaterializedViews::TherapyBrowseTableRow.all } + + option(:ncit_id, type: String, description: 'Limit to therapies with a specific NCIT ID') do |scope, value| + if value.upcase.starts_with?('C') + scope.where(ncit_id: value.upcase) + else + scope.where(ncit_id: "C#{value}") + end + end + + option(:therapy_alias, type: String) do |scope, value| + scope.where(array_query_for_column('alias_names'), "%#{value}%") + end + + option(:id, type: Int, description: "Filter on a therapy's internal CIViC id") do |scope, value| + scope.where(id: id) + end + + option(:name, type: String, description: 'Wildcard match on therapy name') do |scope, value| + scope.where('name ILIKE ?', "%#{value}%") + end + + option(:sort_by, type: Types::BrowseTables::TherapySortType, description: 'Sort order for the therapies. Defaults to the highest evidence item count.') do |scope, value| + scope.reorder("#{value.column} #{value.direction}") + end +end diff --git a/server/app/graphql/resolvers/top_level_diseases.rb b/server/app/graphql/resolvers/top_level_diseases.rb new file mode 100644 index 000000000..7e98ae100 --- /dev/null +++ b/server/app/graphql/resolvers/top_level_diseases.rb @@ -0,0 +1,31 @@ +require 'search_object' +require 'search_object/plugin/graphql' + +class Resolvers::TopLevelDiseases < GraphQL::Schema::Resolver + include SearchObject.module(:graphql) + include Resolvers::Shared::SearchHelpers + + type Types::Entities::DiseaseType.connection_type, null: false + + scope { + Disease + .where(deprecated: false) + .order("diseases.name ASC") + } + + option(:id, type: Int) do |scope, value| + scope.where(id: value) + end + + option(:name, type: String) do |scope, value| + scope.where('name ILIKE ?', "%#{value}%") + end + + option(:doid, type: String) do |scope, value| + if value.upcase.starts_with?('DOID:') + scope.where(doid: value.upcase.gsub('DOID:','')) + else + scope.where(doid: value) + end + end +end diff --git a/server/app/graphql/resolvers/top_level_phenotypes.rb b/server/app/graphql/resolvers/top_level_phenotypes.rb new file mode 100644 index 000000000..38b11eb5e --- /dev/null +++ b/server/app/graphql/resolvers/top_level_phenotypes.rb @@ -0,0 +1,31 @@ +require 'search_object' +require 'search_object/plugin/graphql' + +class Resolvers::TopLevelPhenotypes < GraphQL::Schema::Resolver + include SearchObject.module(:graphql) + + type Types::Entities::PhenotypeType.connection_type, null: false + + description 'List and filter Phenotypes from the Human Phenotype Ontology.' + + scope do + Phenotype + .order('phenotypes.hpo_class ASC') + end + + option(:hpo_id, type: String, description: 'Limit to phenotypes with a specific HPO ID') do |scope, value| + if value.upcase.starts_with?('HP:') + scope.where('hpo_id ILIKE ?', "#{value}%") + else + scope.where('hpo_id ILIKE ?', "HP:#{value}%") + end + end + + option(:id, type: Int, description: 'Filter Phenotype on internal CIViC id') do |scope, value| + scope.where(id: value) + end + + option(:name, type: String, description: 'Wildcard match on phenotype name (class)') do |scope, value| + scope.where('hpo_class ILIKE ?', "%#{value}%") + end +end diff --git a/server/app/graphql/resolvers/top_level_sources.rb b/server/app/graphql/resolvers/top_level_sources.rb new file mode 100644 index 000000000..c013d3435 --- /dev/null +++ b/server/app/graphql/resolvers/top_level_sources.rb @@ -0,0 +1,21 @@ +require 'search_object/plugin/graphql' + +class Resolvers::TopLevelSources < GraphQL::Schema::Resolver + include SearchObject.module(:graphql) + + type Types::Entities::SourceType.connection_type, null: false + + description 'List and filter genes.' + + scope do + Source + .order('sources.citation_id ASC') + .where("sources.retraction_nature != 'Retraction'") + .or(Source.where(retracted: false)) + .distinct + end + + option(:citation_id, type: [GraphQL::Types::String], description: 'List of citation IDs to return results for') do |scope, value| + scope.where('sources.citation_id IN (?)', value) + end +end diff --git a/server/app/graphql/resolvers/top_level_therapies.rb b/server/app/graphql/resolvers/top_level_therapies.rb index a3c218d48..4881c1189 100644 --- a/server/app/graphql/resolvers/top_level_therapies.rb +++ b/server/app/graphql/resolvers/top_level_therapies.rb @@ -5,11 +5,15 @@ class Resolvers::TopLevelTherapies < GraphQL::Schema::Resolver include SearchObject.module(:graphql) include Resolvers::Shared::SearchHelpers - type Types::BrowseTables::BrowseTherapyType.connection_type, null: false + type Types::Entities::TherapyType.connection_type, null: false description 'List and filter Therapies from the NCI Thesaurus.' - scope { MaterializedViews::TherapyBrowseTableRow.all } + scope { + Therapy + .where(deprecated: false) + .order("therapies.name ASC") + } option(:ncit_id, type: String, description: 'Limit to therapies with a specific NCIT ID') do |scope, value| if value.upcase.starts_with?('C') @@ -30,8 +34,4 @@ class Resolvers::TopLevelTherapies < GraphQL::Schema::Resolver option(:name, type: String, description: 'Wildcard match on therapy name') do |scope, value| scope.where('name ILIKE ?', "%#{value}%") end - - option(:sort_by, type: Types::BrowseTables::TherapySortType, description: 'Sort order for the therapies. Defaults to the highest evidence item count.') do |scope, value| - scope.reorder("#{value.column} #{value.direction}") - end end diff --git a/server/app/graphql/types/query_type.rb b/server/app/graphql/types/query_type.rb index 4a3797518..ff131059b 100644 --- a/server/app/graphql/types/query_type.rb +++ b/server/app/graphql/types/query_type.rb @@ -19,10 +19,11 @@ class QueryType < Types::BaseObject field :browseSources, resolver: Resolvers::BrowseSources field :browseVariantGroups, resolver: Resolvers::BrowseVariantGroups field :browseDiseases, resolver: Resolvers::BrowseDiseases + field :browseTherapies, resolver: Resolvers::BrowseTherapies + field :browsePhenotypes, resolver: Resolvers::BrowsePhenotypes field :browseMolecularProfiles, resolver: Resolvers::BrowseMolecularProfiles field :events, resolver: Resolvers::TopLevelEvents field :comments, resolver: Resolvers::TopLevelComments - field :phenotypes, resolver: Resolvers::Phenotypes field :source_suggestions, resolver: Resolvers::BrowseSourceSuggestions field :notifications, resolver: Resolvers::Notifications do def authorized?(object, args, context) @@ -189,6 +190,7 @@ def authorized?(object, args, context) field :evidence_items, resolver: Resolvers::TopLevelEvidenceItems field :assertions, resolver: Resolvers::TopLevelAssertions field :molecular_profiles, resolver: Resolvers::TopLevelMolecularProfiles, max_page_size: 300 + field :sources, resolver: Resolvers::TopLevelSources field :flags, resolver: Resolvers::TopLevelFlags @@ -198,8 +200,12 @@ def authorized?(object, args, context) field :variant_types, resolver: Resolvers::TopLevelVariantTypes + field :diseases, resolver: Resolvers::TopLevelDiseases + field :therapies, resolver: Resolvers::TopLevelTherapies + field :phenotypes, resolver: Resolvers::TopLevelPhenotypes + field :clinical_trials, resolver: Resolvers::TopLevelClinicalTrials field :timepoint_stats, Types::CivicTimepointStats, null: false From 3f39f985a8c3b43441be028220128e9199eba587 Mon Sep 17 00:00:00 2001 From: Susanna Kiwala Date: Tue, 29 Oct 2024 08:17:36 -0500 Subject: [PATCH 2/3] Update server/app/graphql/resolvers/top_level_sources.rb Co-authored-by: Adam Coffman --- server/app/graphql/resolvers/top_level_sources.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/app/graphql/resolvers/top_level_sources.rb b/server/app/graphql/resolvers/top_level_sources.rb index c013d3435..9edf0b87c 100644 --- a/server/app/graphql/resolvers/top_level_sources.rb +++ b/server/app/graphql/resolvers/top_level_sources.rb @@ -5,7 +5,7 @@ class Resolvers::TopLevelSources < GraphQL::Schema::Resolver type Types::Entities::SourceType.connection_type, null: false - description 'List and filter genes.' + description 'List and filter sources.' scope do Source From f88851d7eaddabdb6f71aab081a8e5c25fe24690 Mon Sep 17 00:00:00 2001 From: Susanna Kiwala Date: Tue, 29 Oct 2024 08:24:12 -0500 Subject: [PATCH 3/3] Update schema files --- client/src/app/generated/civic.apollo.ts | 2 +- client/src/app/generated/server.model.graphql | 2 +- client/src/app/generated/server.schema.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/app/generated/civic.apollo.ts b/client/src/app/generated/civic.apollo.ts index df3b36cc8..efcd0b482 100644 --- a/client/src/app/generated/civic.apollo.ts +++ b/client/src/app/generated/civic.apollo.ts @@ -4909,7 +4909,7 @@ export type Query = { sourceSuggestions: SourceSuggestionConnection; /** Provide suggestions for sources based on a partial citation ID */ sourceTypeahead: Array; - /** List and filter genes. */ + /** List and filter sources. */ sources: SourceConnection; /** Get the active subscription for the entity and logged in user, if any */ subscriptionForEntity?: Maybe; diff --git a/client/src/app/generated/server.model.graphql b/client/src/app/generated/server.model.graphql index 3c161171b..5f6103bf0 100644 --- a/client/src/app/generated/server.model.graphql +++ b/client/src/app/generated/server.model.graphql @@ -9457,7 +9457,7 @@ type Query { sourceTypeahead(citationId: String!, sourceType: SourceSource!): [Source!]! """ - List and filter genes. + List and filter sources. """ sources( """ diff --git a/client/src/app/generated/server.schema.json b/client/src/app/generated/server.schema.json index 5bfce0c4f..7b899f155 100644 --- a/client/src/app/generated/server.schema.json +++ b/client/src/app/generated/server.schema.json @@ -43221,7 +43221,7 @@ }, { "name": "sources", - "description": "List and filter genes.", + "description": "List and filter sources.", "args": [ { "name": "citationId",