Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SelectionSetMixin

Hierarchy

  • SelectionSetMixin

Index

Constructors

constructor

Properties

Readonly _fields

_fields: Crud<FieldNode, FieldApi, string | { alias?: NameNode | NameNodeProps; arguments?: ReadonlyArray<ArgumentNodeProps | ArgumentNode>; directives?: ReadonlyArray<DirectiveNodeProps | DirectiveNode>; name: NameNode | NameNodeProps; selections?: ReadonlyArray<SelectionNodeProps | GQL.SelectionNode> }, string> = new Crud({parent: this.node,key: this.node.kind === Kind.SELECTION_SET ? 'selections' : 'selectionSet',api: Api.fieldApi,factory: Ast.fieldNode,matcher: (node): Fieldname => node.name.value,ref: this._selectionsRef,kindFilter: [Kind.FIELD],})

Readonly _fragmentSpreads

_fragmentSpreads: Crud<FragmentSpreadNode, FragmentSpreadApi, string | { directives?: ReadonlyArray<DirectiveNodeProps | DirectiveNode>; name: NameNodeProps | NameNode }, string> = new Crud({parent: this.node,key: this.node.kind === Kind.SELECTION_SET ? 'selections' : 'selectionSet',api: Api.fragmentSpreadApi,factory: Ast.fragmentSpreadNode,matcher: (node): Fragmentname => node.name.value,ref: this._selectionsRef,kindFilter: [Kind.FRAGMENT_SPREAD],})

Readonly _inlineFragments

_inlineFragments: Crud<InlineFragmentNode, InlineFragmentApi, { directives?: ReadonlyArray<DirectiveNodeProps | DirectiveNode>; selections: ReadonlyArray<SelectionNodeProps | GQL.SelectionNode>; typeCondition?: NamedTypeNodeProps | NamedTypeNode }, undefined | string> = new Crud({parent: this.node,key: this.node.kind === Kind.SELECTION_SET ? 'selections' : 'selectionSet',api: Api.inlineFragmentApi,factory: Ast.inlineFragmentNode,matcher: (node): Typename | undefined => node.typeCondition?.name.value,ref: this._selectionsRef,kindFilter: [Kind.INLINE_FRAGMENT],})

Readonly _selections

_selections: Crud<FieldNode | FragmentSpreadNode | InlineFragmentNode, FieldApi | FragmentSpreadApi | InlineFragmentApi, string | { alias?: NameNode | NameNodeProps; arguments?: ReadonlyArray<ArgumentNodeProps | ArgumentNode>; directives?: ReadonlyArray<DirectiveNodeProps | DirectiveNode>; name: NameNode | NameNodeProps; selections?: ReadonlyArray<SelectionNodeProps | GQL.SelectionNode> } | ({ alias?: NameNode | NameNodeProps; arguments?: ReadonlyArray<ArgumentNodeProps | ArgumentNode>; directives?: ReadonlyArray<DirectiveNodeProps | DirectiveNode>; name: NameNode | NameNodeProps; selections?: ReadonlyArray<SelectionNodeProps | GQL.SelectionNode> } & { kind: K }) | ({ directives?: ReadonlyArray<DirectiveNodeProps | DirectiveNode>; name: NameNodeProps | NameNode } & { kind: K }) | ({ directives?: ReadonlyArray<DirectiveNodeProps | DirectiveNode>; selections: ReadonlyArray<SelectionNodeProps | GQL.SelectionNode>; typeCondition?: NamedTypeNodeProps | NamedTypeNode } & { kind: K }), string> = new Crud({parent: this.node,key: this.node.kind === Kind.SELECTION_SET ? 'selections' : 'selectionSet',api: Api.selectionApi,factory: Ast.selectionNode,matcher: (node): string =>(node.kind !== Kind.INLINE_FRAGMENT ? node.name.value : node.typeCondition?.name.value) ?? '',ref: this._selectionsRef,})

Protected _selectionsRef

_selectionsRef: undefined | (Anonymous function) = this.node.kind === Kind.SELECTION_SET ? undefined: (next?: GQL.SelectionNode[]): GQL.SelectionNode[] => {const _node = this.node as Mutable<Exclude<SelectionSetMixinNode, GQL.SelectionSetNode>>if (!_node.selectionSet) {_node.selectionSet = Ast.selectionSetNode({ selections: [] })}if (!_node.selectionSet.selections) {_node.selectionSet.selections = []}if (next) {_node.selectionSet.selections = next}return _node.selectionSet.selections as GQL.SelectionNode[]}

Readonly node

Methods

createField

  • createField(props: Ast.FieldNodeProps | FieldNode): this
  • Parameters

    • props: Ast.FieldNodeProps | FieldNode

    Returns this

createFragmentSpread

  • createFragmentSpread(props: Ast.FragmentSpreadNodeProps | FragmentSpreadNode): this
  • Parameters

    • props: Ast.FragmentSpreadNodeProps | FragmentSpreadNode

    Returns this

createInlineFragment

  • createInlineFragment(props: Ast.InlineFragmentNodeProps | InlineFragmentNode): this
  • Parameters

    • props: Ast.InlineFragmentNodeProps | InlineFragmentNode

    Returns this

getField

  • Parameters

    Returns FieldApi

getFields

  • Returns FieldApi[]

getFragmentSpead

getFragmentSpreads

getInlineFragment

getInlineFragments

getSelectionSet

getSelections

  • getSelections(): Api.SelectionApi[]
  • Returns Api.SelectionApi[]

hasField

  • Parameters

    Returns boolean

hasFragmentSpread

  • Parameters

    Returns boolean

hasInlineFragment

  • hasInlineFragment(typeCondition?: Typename): boolean
  • Parameters

    Returns boolean

hasSelectionSet

  • hasSelectionSet(): boolean
  • Returns boolean

removeField

  • Parameters

    Returns this

removeFragmentSpread

  • removeFragmentSpread(props: Ast.FragmentSpreadNodeProps | FragmentSpreadNode): this
  • Parameters

    • props: Ast.FragmentSpreadNodeProps | FragmentSpreadNode

    Returns this

removeInlineFragment

  • removeInlineFragment(typeCondition: Typename): this
  • Parameters

    Returns this

removeSelectionSet

  • removeSelectionSet(): this
  • Returns this

updateField

  • updateField(fieldname: Fieldname, props: Ast.FieldNodeProps | FieldNode): this
  • Parameters

    • fieldname: Fieldname
    • props: Ast.FieldNodeProps | FieldNode

    Returns this

updateFragmentSpread

  • updateFragmentSpread(fragmentname: Fragmentname, props: Ast.FragmentSpreadNodeProps | Partial<Ast.FragmentSpreadNodeProps> | FragmentSpreadNode): this
  • Parameters

    • fragmentname: Fragmentname
    • props: Ast.FragmentSpreadNodeProps | Partial<Ast.FragmentSpreadNodeProps> | FragmentSpreadNode

    Returns this

updateInlineFragment

  • updateInlineFragment(typeCondition: Typename | undefined, props: Partial<Ast.InlineFragmentNodeProps | InlineFragmentNode>): this
  • Parameters

    • typeCondition: Typename | undefined
    • props: Partial<Ast.InlineFragmentNodeProps | InlineFragmentNode>

    Returns this

upsertField

  • upsertField(props: Ast.FieldNodeProps | FieldNode): this
  • Parameters

    • props: Ast.FieldNodeProps | FieldNode

    Returns this

upsertFragmentSpread

  • upsertFragmentSpread(props: Ast.FragmentSpreadNodeProps | FragmentSpreadNode): this
  • Parameters

    • props: Ast.FragmentSpreadNodeProps | FragmentSpreadNode

    Returns this

upsertInlineFragment

  • upsertInlineFragment(props: Ast.InlineFragmentNodeProps | InlineFragmentNode): this
  • Parameters

    • props: Ast.InlineFragmentNodeProps | InlineFragmentNode

    Returns this

Generated using TypeDoc