diff --git a/client/src/app/components/events/event-timeline-item/event-timeline-item.component.html b/client/src/app/components/events/event-timeline-item/event-timeline-item.component.html index 2e018ae9b..050a468ca 100644 --- a/client/src/app/components/events/event-timeline-item/event-timeline-item.component.html +++ b/client/src/app/components/events/event-timeline-item/event-timeline-item.component.html @@ -12,7 +12,7 @@ *ngIf="tagDisplay != 'hideUser'"> - {{ event.action | eventVerbiage : 'feed' }}  + {{ event.action | eventVerbiage: 'feed' }}  @@ -76,7 +76,10 @@ *ngSwitchCase="'EvidenceItem'" [evidence]="subject"> + ): string { if (!value) return '' + if (value.endsWith('Variant')) { + return 'civic-variant' + } return `civic-${value.replace(/_/g, '').toLowerCase()}` } } diff --git a/client/src/app/core/utilities/get-entity-color.ts b/client/src/app/core/utilities/get-entity-color.ts index 4f83ffae5..4e6ae1218 100644 --- a/client/src/app/core/utilities/get-entity-color.ts +++ b/client/src/app/core/utilities/get-entity-color.ts @@ -14,6 +14,8 @@ export const EntityColors = new Map([ ['Source', '#f9ba45'], ['Therapy', '#ac3996'], ['Variant', '#74d34c'], + ['GeneVariant', '#74d34c'], + ['FactorVariant', '#74d34c'], ['VariantGroup', '#74d34c'], ['VariantType', '#74d34c'], diff --git a/client/src/app/forms/types/feature-select/feature-select.type.html b/client/src/app/forms/types/feature-select/feature-select.type.html index 5e9caaa09..ef8a65f20 100644 --- a/client/src/app/forms/types/feature-select/feature-select.type.html +++ b/client/src/app/forms/types/feature-select/feature-select.type.html @@ -5,7 +5,7 @@ + (ngModelChange)="this.onFeatureType$.next($event)"> diff --git a/client/src/app/forms/types/feature-select/feature-select.type.ts b/client/src/app/forms/types/feature-select/feature-select.type.ts index a47644d71..cfd137d72 100644 --- a/client/src/app/forms/types/feature-select/feature-select.type.ts +++ b/client/src/app/forms/types/feature-select/feature-select.type.ts @@ -32,7 +32,8 @@ import { FormlyFieldProps } from '@ngx-formly/ng-zorro-antd/form-field' import { NzSelectOptionInterface } from 'ng-zorro-antd/select' import mixin from 'ts-mixin-extended' import { FeatureIdWithCreationStatus } from './feature-quick-add/feature-quick-add.form' -import { BehaviorSubject } from 'rxjs' +import { BehaviorSubject, Subscription } from 'rxjs' +import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy' export type CvcFeatureSelectFieldOption = Partial< FieldTypeConfig> @@ -67,6 +68,7 @@ const FeatureSelectMixin = mixin( >() ) +@UntilDestroy() @Component({ selector: 'cvc-feature-select', templateUrl: './feature-select.type.html', @@ -94,7 +96,7 @@ export class CvcFeatureSelectField optionTemplates?: QueryList> selectedFeatureType?: FeatureInstanceTypes = this.props.featureType - onFeatureType$?: BehaviorSubject> = + onFeatureType$: BehaviorSubject> = new BehaviorSubject>(undefined) constructor( @@ -107,6 +109,12 @@ export class CvcFeatureSelectField ngAfterViewInit(): void { this.selectedFeatureType = this.props.featureType + if (this.props.featureTypeCallback) { + this.onFeatureType$ + .pipe(untilDestroyed(this)) + .subscribe((ft) => this.props.featureTypeCallback(ft)) + this.onFeatureType$.next(this.selectedFeatureType) + } this.configureBaseField() // mixin fn this.configureEntitySelectField({ // mixin fn diff --git a/client/src/app/forms/types/molecular-profile-select/mp-finder/mp-finder.component.ts b/client/src/app/forms/types/molecular-profile-select/mp-finder/mp-finder.component.ts index 61caeb843..6c6cde0ec 100644 --- a/client/src/app/forms/types/molecular-profile-select/mp-finder/mp-finder.component.ts +++ b/client/src/app/forms/types/molecular-profile-select/mp-finder/mp-finder.component.ts @@ -7,7 +7,11 @@ import { import { UntypedFormGroup } from '@angular/forms' import { EntityFieldSubjectMap } from '@app/forms/states/base.state' import { CvcFormRowWrapperProps } from '@app/forms/wrappers/form-row/form-row.wrapper' -import { MolecularProfile, Variant } from '@app/generated/civic.apollo' +import { + CreateableFeatureTypes, + MolecularProfile, + Variant, +} from '@app/generated/civic.apollo' import { FormlyFieldConfig, FormlyFormOptions } from '@ngx-formly/core' import { Apollo, gql } from 'apollo-angular' import { Maybe } from 'graphql/jsutils/Maybe' @@ -15,6 +19,7 @@ import { NzFormLayoutType } from 'ng-zorro-antd/form' import { BehaviorSubject } from 'rxjs' import { tag } from 'rxjs-spy/operators' import { CvcVariantSelectFieldOption } from '../../variant-select/variant-select.type' +import { EnumToTitlePipe } from '@app/core/pipes/enum-to-title-pipe' type MpFinderModel = { featureId?: number @@ -40,6 +45,7 @@ export class MpFinderComponent { model: MpFinderModel form: UntypedFormGroup config: FormlyFieldConfig[] + featureType?: CreateableFeatureTypes finderState: MpFinderState = { formLayout: 'horizontal', @@ -76,6 +82,9 @@ export class MpFinderComponent { showExtra: false, showErrorTip: false, required: true, + featureTypeCallback: (ft: CreateableFeatureTypes) => { + this.featureType = ft + }, }, }, { @@ -110,10 +119,11 @@ export class MpFinderComponent { getSelectedVariant(variantId: Maybe): Maybe { if (!variantId) return + const feature = new EnumToTitlePipe().transform(this.featureType) const fragment = { - id: `Variant:${variantId}`, + id: `${feature}Variant:${variantId}`, fragment: gql` - fragment VariantSelectQuery on Variant { + fragment VariantSelectQuery on ${feature}Variant { id name link diff --git a/client/src/app/forms/types/variant-select/variant-select.query.gql b/client/src/app/forms/types/variant-select/variant-select.query.gql index 26271c7c0..acb4cfe10 100644 --- a/client/src/app/forms/types/variant-select/variant-select.query.gql +++ b/client/src/app/forms/types/variant-select/variant-select.query.gql @@ -14,7 +14,15 @@ query VariantSelectTypeahead($name: String!, $featureId: Int) { query VariantSelectTag($variantId: Int!) { variant(id: $variantId) { - ...VariantSelectTypeaheadFields + ... on Variant { + ...VariantSelectTypeaheadFields + } + ... on GeneVariant { + ...VariantSelectTypeaheadFields + } + ... on FactorVariant { + ...VariantSelectTypeaheadFields + } } } diff --git a/client/src/app/generated/civic.apollo-helpers.ts b/client/src/app/generated/civic.apollo-helpers.ts index 457a3aa10..6394bf40e 100644 --- a/client/src/app/generated/civic.apollo-helpers.ts +++ b/client/src/app/generated/civic.apollo-helpers.ts @@ -2125,6 +2125,19 @@ export type VariantAliasKeySpecifier = ('name' | VariantAliasKeySpecifier)[]; export type VariantAliasFieldPolicy = { name?: FieldPolicy | FieldReadFunction }; +export type VariantConnectionKeySpecifier = ('edges' | 'nodes' | 'pageCount' | 'pageInfo' | 'totalCount' | VariantConnectionKeySpecifier)[]; +export type VariantConnectionFieldPolicy = { + edges?: FieldPolicy | FieldReadFunction, + nodes?: FieldPolicy | FieldReadFunction, + pageCount?: FieldPolicy | FieldReadFunction, + pageInfo?: FieldPolicy | FieldReadFunction, + totalCount?: FieldPolicy | FieldReadFunction +}; +export type VariantEdgeKeySpecifier = ('cursor' | 'node' | VariantEdgeKeySpecifier)[]; +export type VariantEdgeFieldPolicy = { + cursor?: FieldPolicy | FieldReadFunction, + node?: FieldPolicy | FieldReadFunction +}; export type VariantGroupKeySpecifier = ('comments' | 'description' | 'events' | 'flagged' | 'flags' | 'id' | 'lastAcceptedRevisionEvent' | 'lastCommentEvent' | 'lastSubmittedRevisionEvent' | 'link' | 'name' | 'revisions' | 'sources' | 'variants' | VariantGroupKeySpecifier)[]; export type VariantGroupFieldPolicy = { comments?: FieldPolicy | FieldReadFunction, @@ -3038,6 +3051,14 @@ export type StrictTypedTypePolicies = { keyFields?: false | VariantAliasKeySpecifier | (() => undefined | VariantAliasKeySpecifier), fields?: VariantAliasFieldPolicy, }, + VariantConnection?: Omit & { + keyFields?: false | VariantConnectionKeySpecifier | (() => undefined | VariantConnectionKeySpecifier), + fields?: VariantConnectionFieldPolicy, + }, + VariantEdge?: Omit & { + keyFields?: false | VariantEdgeKeySpecifier | (() => undefined | VariantEdgeKeySpecifier), + fields?: VariantEdgeFieldPolicy, + }, VariantGroup?: Omit & { keyFields?: false | VariantGroupKeySpecifier | (() => undefined | VariantGroupKeySpecifier), fields?: VariantGroupFieldPolicy, diff --git a/client/src/app/generated/civic.apollo.ts b/client/src/app/generated/civic.apollo.ts index 3554e1a5d..7d776a240 100644 --- a/client/src/app/generated/civic.apollo.ts +++ b/client/src/app/generated/civic.apollo.ts @@ -1952,7 +1952,7 @@ export type Factor = Commentable & EventOriginObject & EventSubject & Flaggable revisions: RevisionConnection; sources: Array; /** List and filter variants. */ - variants: VariantInterfaceConnection; + variants: VariantConnection; }; @@ -2172,7 +2172,7 @@ export type Feature = Commentable & EventOriginObject & EventSubject & Flaggable revisions: RevisionConnection; sources: Array; /** List and filter variants. */ - variants: VariantInterfaceConnection; + variants: VariantConnection; }; @@ -2478,7 +2478,7 @@ export type Gene = Commentable & EventOriginObject & EventSubject & Flaggable & revisions: RevisionConnection; sources: Array; /** List and filter variants. */ - variants: VariantInterfaceConnection; + variants: VariantConnection; }; @@ -6281,6 +6281,21 @@ export type VariantComponent = { variantId: Scalars['Int']; }; +/** The connection type for Variant. */ +export type VariantConnection = { + __typename: 'VariantConnection'; + /** 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']; + /** Information to aid in pagination. */ + pageInfo: PageInfo; + /** The total number of records in this filtered collection. */ + totalCount: Scalars['Int']; +}; + export enum VariantDeprecationReason { Duplicate = 'DUPLICATE', FeatureDeprecated = 'FEATURE_DEPRECATED', @@ -6288,6 +6303,15 @@ export enum VariantDeprecationReason { Other = 'OTHER' } +/** An edge in a connection. */ +export type VariantEdge = { + __typename: 'VariantEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node?: Maybe; +}; + export type VariantGroup = Commentable & EventSubject & Flaggable & WithRevisions & { __typename: 'VariantGroup'; /** List and filter comments. */ @@ -6308,7 +6332,7 @@ export type VariantGroup = Commentable & EventSubject & Flaggable & WithRevision revisions: RevisionConnection; sources: Array; /** List and filter variants. */ - variants: VariantInterfaceConnection; + variants: VariantConnection; }; @@ -6933,9 +6957,9 @@ export type FeaturePopoverQueryVariables = Exact<{ }>; -export type FeaturePopoverQuery = { __typename: 'Query', feature?: { __typename: 'Feature', id: number, name: string, featureAliases: Array, featureInstance: { __typename: 'Factor' } | { __typename: 'Gene' }, variants: { __typename: 'VariantInterfaceConnection', totalCount: number }, flags: { __typename: 'FlagConnection', totalCount: number } } | undefined }; +export type FeaturePopoverQuery = { __typename: 'Query', feature?: { __typename: 'Feature', id: number, name: string, featureAliases: Array, featureInstance: { __typename: 'Factor' } | { __typename: 'Gene' }, variants: { __typename: 'VariantConnection', totalCount: number }, flags: { __typename: 'FlagConnection', totalCount: number } } | undefined }; -export type FeaturePopoverFragment = { __typename: 'Feature', id: number, name: string, featureAliases: Array, featureInstance: { __typename: 'Factor' } | { __typename: 'Gene' }, variants: { __typename: 'VariantInterfaceConnection', totalCount: number }, flags: { __typename: 'FlagConnection', totalCount: number } }; +export type FeaturePopoverFragment = { __typename: 'Feature', id: number, name: string, featureAliases: Array, featureInstance: { __typename: 'Factor' } | { __typename: 'Gene' }, variants: { __typename: 'VariantConnection', totalCount: number }, flags: { __typename: 'FlagConnection', totalCount: number } }; export type BrowseFeaturesQueryVariables = Exact<{ featureName?: InputMaybe; @@ -7378,9 +7402,9 @@ export type VariantGroupPopoverQueryVariables = Exact<{ }>; -export type VariantGroupPopoverQuery = { __typename: 'Query', variantGroup?: { __typename: 'VariantGroup', id: number, name: string, description: string, variants: { __typename: 'VariantInterfaceConnection', edges: Array<{ __typename: 'VariantInterfaceEdge', node?: { __typename: 'FactorVariant', id: number, name: string, link: string, deprecated: boolean, feature: { __typename: 'Feature', id: number, name: string, link: string } } | { __typename: 'GeneVariant', id: number, name: string, link: string, deprecated: boolean, feature: { __typename: 'Feature', id: number, name: string, link: string } } | { __typename: 'Variant', id: number, name: string, link: string, deprecated: boolean, feature: { __typename: 'Feature', id: number, name: string, link: string } } | undefined }> }, sources: Array<{ __typename: 'Source', id: number, citation?: string | undefined, sourceType: SourceSource, link: string }> } | undefined }; +export type VariantGroupPopoverQuery = { __typename: 'Query', variantGroup?: { __typename: 'VariantGroup', id: number, name: string, description: string, variants: { __typename: 'VariantConnection', edges: Array<{ __typename: 'VariantEdge', node?: { __typename: 'Variant', id: number, name: string, link: string, deprecated: boolean, feature: { __typename: 'Feature', id: number, name: string, link: string } } | undefined }> }, sources: Array<{ __typename: 'Source', id: number, citation?: string | undefined, sourceType: SourceSource, link: string }> } | undefined }; -export type VariantGroupPopoverFieldsFragment = { __typename: 'VariantGroup', id: number, name: string, description: string, variants: { __typename: 'VariantInterfaceConnection', edges: Array<{ __typename: 'VariantInterfaceEdge', node?: { __typename: 'FactorVariant', id: number, name: string, link: string, deprecated: boolean, feature: { __typename: 'Feature', id: number, name: string, link: string } } | { __typename: 'GeneVariant', id: number, name: string, link: string, deprecated: boolean, feature: { __typename: 'Feature', id: number, name: string, link: string } } | { __typename: 'Variant', id: number, name: string, link: string, deprecated: boolean, feature: { __typename: 'Feature', id: number, name: string, link: string } } | undefined }> }, sources: Array<{ __typename: 'Source', id: number, citation?: string | undefined, sourceType: SourceSource, link: string }> }; +export type VariantGroupPopoverFieldsFragment = { __typename: 'VariantGroup', id: number, name: string, description: string, variants: { __typename: 'VariantConnection', edges: Array<{ __typename: 'VariantEdge', node?: { __typename: 'Variant', id: number, name: string, link: string, deprecated: boolean, feature: { __typename: 'Feature', id: number, name: string, link: string } } | undefined }> }, sources: Array<{ __typename: 'Source', id: number, citation?: string | undefined, sourceType: SourceSource, link: string }> }; export type BrowseVariantGroupsQueryVariables = Exact<{ first?: InputMaybe; @@ -7827,9 +7851,9 @@ export type VariantGroupRevisableFieldsQueryVariables = Exact<{ }>; -export type VariantGroupRevisableFieldsQuery = { __typename: 'Query', variantGroup?: { __typename: 'VariantGroup', id: number, name: string, description: string, variants: { __typename: 'VariantInterfaceConnection', totalCount: number, edges: Array<{ __typename: 'VariantInterfaceEdge', cursor: string, node?: { __typename: 'FactorVariant', id: number, name: string, link: string } | { __typename: 'GeneVariant', id: number, name: string, link: string } | { __typename: 'Variant', id: number, name: string, link: string } | undefined }>, nodes: Array<{ __typename: 'FactorVariant', id: number, name: string, link: string } | { __typename: 'GeneVariant', id: number, name: string, link: string } | { __typename: 'Variant', id: number, name: string, link: string }> }, sources: Array<{ __typename: 'Source', id: number, name: string, link: string }> } | undefined }; +export type VariantGroupRevisableFieldsQuery = { __typename: 'Query', variantGroup?: { __typename: 'VariantGroup', id: number, name: string, description: string, variants: { __typename: 'VariantConnection', totalCount: number, edges: Array<{ __typename: 'VariantEdge', cursor: string, node?: { __typename: 'Variant', id: number, name: string, link: string } | undefined }>, nodes: Array<{ __typename: 'Variant', id: number, name: string, link: string }> }, sources: Array<{ __typename: 'Source', id: number, name: string, link: string }> } | undefined }; -export type VariantGroupRevisableFieldsFragment = { __typename: 'VariantGroup', id: number, name: string, description: string, variants: { __typename: 'VariantInterfaceConnection', totalCount: number, edges: Array<{ __typename: 'VariantInterfaceEdge', cursor: string, node?: { __typename: 'FactorVariant', id: number, name: string, link: string } | { __typename: 'GeneVariant', id: number, name: string, link: string } | { __typename: 'Variant', id: number, name: string, link: string } | undefined }>, nodes: Array<{ __typename: 'FactorVariant', id: number, name: string, link: string } | { __typename: 'GeneVariant', id: number, name: string, link: string } | { __typename: 'Variant', id: number, name: string, link: string }> }, sources: Array<{ __typename: 'Source', id: number, name: string, link: string }> }; +export type VariantGroupRevisableFieldsFragment = { __typename: 'VariantGroup', id: number, name: string, description: string, variants: { __typename: 'VariantConnection', totalCount: number, edges: Array<{ __typename: 'VariantEdge', cursor: string, node?: { __typename: 'Variant', id: number, name: string, link: string } | undefined }>, nodes: Array<{ __typename: 'Variant', id: number, name: string, link: string }> }, sources: Array<{ __typename: 'Source', id: number, name: string, link: string }> }; export type SuggestVariantGroupRevisionMutationVariables = Exact<{ input: SuggestVariantGroupRevisionInput; @@ -7843,9 +7867,9 @@ export type VariantGroupSubmittableFieldsQueryVariables = Exact<{ }>; -export type VariantGroupSubmittableFieldsQuery = { __typename: 'Query', variantGroup?: { __typename: 'VariantGroup', id: number, name: string, description: string, variants: { __typename: 'VariantInterfaceConnection', nodes: Array<{ __typename: 'FactorVariant', id: number, name: string, link: string, singleVariantMolecularProfile: { __typename: 'MolecularProfile', id: number, name: string, link: string } } | { __typename: 'GeneVariant', id: number, name: string, link: string, singleVariantMolecularProfile: { __typename: 'MolecularProfile', id: number, name: string, link: string } } | { __typename: 'Variant', id: number, name: string, link: string, singleVariantMolecularProfile: { __typename: 'MolecularProfile', id: number, name: string, link: string } }> }, sources: Array<{ __typename: 'Source', id: number, link: string, citation?: string | undefined, sourceType: SourceSource }> } | undefined }; +export type VariantGroupSubmittableFieldsQuery = { __typename: 'Query', variantGroup?: { __typename: 'VariantGroup', id: number, name: string, description: string, variants: { __typename: 'VariantConnection', nodes: Array<{ __typename: 'Variant', id: number, name: string, link: string, singleVariantMolecularProfile: { __typename: 'MolecularProfile', id: number, name: string, link: string } }> }, sources: Array<{ __typename: 'Source', id: number, link: string, citation?: string | undefined, sourceType: SourceSource }> } | undefined }; -export type SubmittableVariantGroupFieldsFragment = { __typename: 'VariantGroup', id: number, name: string, description: string, variants: { __typename: 'VariantInterfaceConnection', nodes: Array<{ __typename: 'FactorVariant', id: number, name: string, link: string, singleVariantMolecularProfile: { __typename: 'MolecularProfile', id: number, name: string, link: string } } | { __typename: 'GeneVariant', id: number, name: string, link: string, singleVariantMolecularProfile: { __typename: 'MolecularProfile', id: number, name: string, link: string } } | { __typename: 'Variant', id: number, name: string, link: string, singleVariantMolecularProfile: { __typename: 'MolecularProfile', id: number, name: string, link: string } }> }, sources: Array<{ __typename: 'Source', id: number, link: string, citation?: string | undefined, sourceType: SourceSource }> }; +export type SubmittableVariantGroupFieldsFragment = { __typename: 'VariantGroup', id: number, name: string, description: string, variants: { __typename: 'VariantConnection', nodes: Array<{ __typename: 'Variant', id: number, name: string, link: string, singleVariantMolecularProfile: { __typename: 'MolecularProfile', id: number, name: string, link: string } }> }, sources: Array<{ __typename: 'Source', id: number, link: string, citation?: string | undefined, sourceType: SourceSource }> }; export type SubmitVariantGroupMutationVariables = Exact<{ input: SubmitVariantGroupInput; @@ -8483,9 +8507,9 @@ export type VariantGroupDetailQueryVariables = Exact<{ }>; -export type VariantGroupDetailQuery = { __typename: 'Query', variantGroup?: { __typename: 'VariantGroup', id: number, name: string, variants: { __typename: 'VariantInterfaceConnection', totalCount: number }, flags: { __typename: 'FlagConnection', totalCount: number }, revisions: { __typename: 'RevisionConnection', totalCount: number }, comments: { __typename: 'CommentConnection', totalCount: number } } | undefined }; +export type VariantGroupDetailQuery = { __typename: 'Query', variantGroup?: { __typename: 'VariantGroup', id: number, name: string, variants: { __typename: 'VariantConnection', totalCount: number }, flags: { __typename: 'FlagConnection', totalCount: number }, revisions: { __typename: 'RevisionConnection', totalCount: number }, comments: { __typename: 'CommentConnection', totalCount: number } } | undefined }; -export type VariantGroupDetailFieldsFragment = { __typename: 'VariantGroup', id: number, name: string, variants: { __typename: 'VariantInterfaceConnection', totalCount: number }, flags: { __typename: 'FlagConnection', totalCount: number }, revisions: { __typename: 'RevisionConnection', totalCount: number }, comments: { __typename: 'CommentConnection', totalCount: number } }; +export type VariantGroupDetailFieldsFragment = { __typename: 'VariantGroup', id: number, name: string, variants: { __typename: 'VariantConnection', totalCount: number }, flags: { __typename: 'FlagConnection', totalCount: number }, revisions: { __typename: 'RevisionConnection', totalCount: number }, comments: { __typename: 'CommentConnection', totalCount: number } }; export type VariantGroupsSummaryQueryVariables = Exact<{ variantGroupId: Scalars['Int']; @@ -15034,7 +15058,15 @@ export const VariantSelectTypeaheadDocument = gql` export const VariantSelectTagDocument = gql` query VariantSelectTag($variantId: Int!) { variant(id: $variantId) { - ...VariantSelectTypeaheadFields + ... on Variant { + ...VariantSelectTypeaheadFields + } + ... on GeneVariant { + ...VariantSelectTypeaheadFields + } + ... on FactorVariant { + ...VariantSelectTypeaheadFields + } } } ${VariantSelectTypeaheadFieldsFragmentDoc}`; diff --git a/client/src/app/generated/server.model.graphql b/client/src/app/generated/server.model.graphql index 193dbcd93..d773c9ca2 100644 --- a/client/src/app/generated/server.model.graphql +++ b/client/src/app/generated/server.model.graphql @@ -3220,7 +3220,7 @@ type Factor implements Commentable & EventOriginObject & EventSubject & Flaggabl Left anchored filtering for variant name and aliases. """ name: String - ): VariantInterfaceConnection! + ): VariantConnection! } """ @@ -3738,7 +3738,7 @@ type Feature implements Commentable & EventOriginObject & EventSubject & Flaggab Left anchored filtering for variant name and aliases. """ name: String - ): VariantInterfaceConnection! + ): VariantConnection! } enum FeatureDeprecationReason { @@ -4325,7 +4325,7 @@ type Gene implements Commentable & EventOriginObject & EventSubject & Flaggable Left anchored filtering for variant name and aliases. """ name: String - ): VariantInterfaceConnection! + ): VariantConnection! } """ @@ -10424,6 +10424,36 @@ input VariantComponent { variantId: Int! } +""" +The connection type for Variant. +""" +type VariantConnection { + """ + A list of edges. + """ + edges: [VariantEdge!]! + + """ + A list of nodes. + """ + nodes: [Variant!]! + + """ + 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! +} + enum VariantDeprecationReason { DUPLICATE FEATURE_DEPRECATED @@ -10431,6 +10461,21 @@ enum VariantDeprecationReason { OTHER } +""" +An edge in a connection. +""" +type VariantEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: Variant +} + type VariantGroup implements Commentable & EventSubject & Flaggable & WithRevisions { """ List and filter comments. @@ -10647,7 +10692,7 @@ type VariantGroup implements Commentable & EventSubject & Flaggable & WithRevisi Left anchored filtering for variant name and aliases. """ name: String - ): VariantInterfaceConnection! + ): VariantConnection! } """ diff --git a/client/src/app/generated/server.schema.json b/client/src/app/generated/server.schema.json index 92fcef24b..d112df061 100644 --- a/client/src/app/generated/server.schema.json +++ b/client/src/app/generated/server.schema.json @@ -15974,7 +15974,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "VariantInterfaceConnection", + "name": "VariantConnection", "ofType": null } }, @@ -17942,7 +17942,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "VariantInterfaceConnection", + "name": "VariantConnection", "ofType": null } }, @@ -20366,7 +20366,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "VariantInterfaceConnection", + "name": "VariantConnection", "ofType": null } }, @@ -47244,6 +47244,113 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "VariantConnection", + "description": "The connection type for Variant.", + "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": "VariantEdge", + "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": "Variant", + "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": "ENUM", "name": "VariantDeprecationReason", @@ -47279,6 +47386,45 @@ ], "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "VariantEdge", + "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": "Variant", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "VariantGroup", @@ -47970,7 +48116,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "VariantInterfaceConnection", + "name": "VariantConnection", "ofType": null } }, diff --git a/server/app/graphql/resolvers/variants.rb b/server/app/graphql/resolvers/variants.rb index 89c90d7ff..ccf042021 100644 --- a/server/app/graphql/resolvers/variants.rb +++ b/server/app/graphql/resolvers/variants.rb @@ -4,7 +4,7 @@ class Resolvers::Variants < GraphQL::Schema::Resolver include SearchObject.module(:graphql) - type Types::Interfaces::VariantInterface.connection_type, null: false + type Types::Entities::VariantType.connection_type, null: false description 'List and filter variants.'