Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "internal/graph/graphQL"

Index

Type aliases

SubscriptionVariables

SubscriptionVariables: Record<string, string | boolean | number | ParameterEnum | string[] | boolean[] | number[] | (() => string | boolean | number | ParameterEnum | string[] | boolean[] | number[])>

Variables

Const FragmentExpression

FragmentExpression: RegExp = /\.\.\.\s*([_A-Za-z][_0-9A-Za-z]*)/gi

Const OperationNameExpression

OperationNameExpression: RegExp = /(subscription|query)[\s]*([^({\s]*)/i

Const OperationParameterExpression

OperationParameterExpression: RegExp = /(?:subscription|query)[\s]*([\S]*?)\s*(\([\S\s]*?\))\s*[\S\s]*?{/i

Const schema

schema: any = require("../../graph/schema.json")

Functions

enumValue

ingester

inlineFragments

  • inlineFragments(q: string, name: string, moduleDir: string, fragmentDir: string): string

inlineQuery

  • inlineQuery(q: string): string

locateAndLoadGraphql

  • locateAndLoadGraphql(options: { name?: string; path?: string }, subfolder: string, moduleDir: string): string
  • Parameters

    • options: { name?: string; path?: string }
      • Optional name?: string
      • Optional path?: string
    • subfolder: string
    • moduleDir: string

    Returns string

mutate

  • Prepare a GraphQL mutation string for the use with Apollo.

    Mutations can be provided by the following options:

    • mutation: string containing the subscription GraphQL, or
    • path: absolute or relative path to a .graphql file to load; if provided a relative
         path this will resolve the relative path to an absolute given the location
         of the calling script.
      
    • name: name of the .graphql file to load; this will walk up the directory structure
         starting a t the location of the calling script and look for a folder called
         'graphql'. Once that folder is found, by convention name is being looked for
         in the 'mutation' sub directory.
      
    • moduleDir: location of the calling script
    • inline: remove any unneeded whitespace and line breaks from returned GraphQL string

    Type parameters

    • T

    • Q

    Parameters

    Returns string

operationName

  • operationName(q: string): string

prettyPrintErrors

  • prettyPrintErrors(errors: GraphQLError[], q?: string): string

query

  • Prepare a GraphQL query string for the use with Apollo.

    Queries can be provided by the following options:

    • query: string containing the subscription GraphQL, or
    • path: absolute or relative path to a .graphql file to load; if provided a relative
         path this will resolve the relative path to an absolute given the location
         of the calling script.
      
    • name: name of the .graphql file to load; this will walk up the directory structure
         starting at the location of the calling script and look for a folder called
         'graphql'. Once that folder is found, by convention name is being looked for
         in the 'query' sub directory.
      
    • fragmentsDir: location of fragment .graphql files
    • moduleDir: location of the calling script
    • inline: remove any unneeded whitespace and line breaks from returned GraphQL string

    Type parameters

    • T

    • Q

    Parameters

    Returns string

replace

  • replace(q: string, key: string, value: string): string

replaceOperationName

  • replaceOperationName(q: string, name: string): string

replaceParameters

resolveAndReadFileSync

  • resolveAndReadFileSync(path: string, current?: string, parameters?: {}): string

subscription

Generated using TypeDoc