Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "discourse/parseLiteral"

Index

Functions

Functions

parseLiteral

  • parseLiteral<DataImmutable, DataMutable>(ast: ValueNode, variables: IVariables | null | undefined, factory: function): Internal<DataMutable>
  • Invoked when a value is passed inline to a GraphQL query. Due to GraphQL language not being quite JSON, the inline value will need to be converted into the GraphQL AST. This function coerces to the internal type.

    query {
      update(link:{ type: 'direct', id: "d5be6f95-d521-4576-b27f-f662d7fd9dec" })
    }
    throws

    { TypeError } invalid incoming data

    Type parameters

    • DataImmutable

    • DataMutable: DataImmutable

    Parameters

    • ast: ValueNode
    • variables: IVariables | null | undefined

      any variables that require replacement

    • factory: function
        • (data: DataImmutable): DataMutable
        • Parameters

          • data: DataImmutable

          Returns DataMutable

    Returns Internal<DataMutable>

    a concrete Link class