Options
All
  • Public
  • Public/Protected
  • All
Menu

ra-postgraphile

Index

Type aliases

AllParams

AllParams: GetOneParams | GetManyReferenceParams | UpdateManyParams | CreateParams | DeleteManyParams | GetListParams | GetManyParams | DeleteParams | ListParams | UpdateParams

FetchQueryType

FetchQueryType: typeof GET_MANY | typeof GET_LIST | typeof GET_ONE | typeof GET_MANY_REFERENCE | typeof DELETE | typeof UPDATE | typeof CREATE

FilterSpec

FilterSpec: { key?: undefined | string; operator: Operator; value?: any } | { key?: undefined | string; operator?: Operator; value: Record<string, any> }

IntrospectionResult

IntrospectionResult: { queries: Array<any>; resources: Array<any>; schema: IntrospectionSchema; types: ReadonlyArray<IntrospectionType> }

Type declaration

  • queries: Array<any>
  • resources: Array<any>
  • schema: IntrospectionSchema
  • types: ReadonlyArray<IntrospectionType>

Operator

Operator: "isNull" | "equalTo" | "notEqualTo" | "distinctFrom" | "notDistinctFrom" | "in" | "notIn" | "includes" | "notIncludes" | "includesInsensitive" | "notIncludesInsensitive" | "startsWith" | "notStartsWith" | "startsWithInsensitive" | "notStartsWithInsensitive" | "endsWith" | "notEndsWith" | "endsWithInsensitive" | "notEndsWithInsensitive" | "like" | "notLike" | "likeInsensitive" | "notLikeInsensitive" | "contains" | "containsKey" | "containsAllKeys" | "containsAnyKeys" | "containedBy" | "containedByOrEqualTo" | "containsOrContainedBy" | "matches"

RequiredPrimaryKeyType

RequiredPrimaryKeyType: IntrospectionNamedTypeRef<IntrospectionOutputType> | IntrospectionNonNullTypeRef<IntrospectionNamedTypeRef<IntrospectionOutputType>>

SortDirection

SortDirection: "ASC" | "DESC"

Variables

Const ARGUMENT_CONDITION

ARGUMENT_CONDITION: "condition" = "condition"

Const ARGUMENT_FILTER

ARGUMENT_FILTER: "filter" = "filter"

Const ARGUMENT_ORDER_BY

ARGUMENT_ORDER_BY: "orderBy" = "orderBy"

Const CAMEL_REGEX

CAMEL_REGEX: RegExp = /(.+?)([A-Z])/gm

Const DEFAULT_ID_FIELD_NAME

DEFAULT_ID_FIELD_NAME: "id" = "id"

Const NATURAL_SORTING

NATURAL_SORTING: "NATURAL" = "NATURAL"

Let queryMap

queryMap: QueryMap

Let typeMap

typeMap: TypeMap

Functions

Const applyArgumentsForField

  • applyArgumentsForField(fieldName: string, typeConfig: TypeConfig, args: ReadonlyArray<IntrospectionInputValue>): string
  • Parameters

    • fieldName: string
    • typeConfig: TypeConfig
    • args: ReadonlyArray<IntrospectionInputValue>

    Returns string

Const buildQuery

Const capitalize

  • capitalize(str: string): string

Const createFilter

  • createFilter(fields: {}, type: IntrospectionType): FilterMap | undefined

Const createGetListQuery

  • createGetListQuery(type: IntrospectionType, manyLowerResourceName: string, resourceTypename: string, pluralizedResourceTypeName: string, typeMap: TypeMap, queryMap: QueryMap, typeConfiguration: TypeConfigMap, primaryKey: PrimaryKey, fetchQueryType: FetchQueryType): DocumentNode

Const createGetManyQuery

  • createGetManyQuery(type: any, manyLowerResourceName: string, resourceTypename: string, typeMap: any, queryMap: QueryMap, typeConfiguration: TypeConfigMap, primaryKey: PrimaryKey, fetchQueryType: FetchQueryType): DocumentNode

Const createQueryFromType

Const createSortingKey

Const createTypeMap

  • createTypeMap(types: ReadonlyArray<IntrospectionType>): {}
  • Parameters

    • types: ReadonlyArray<IntrospectionType>

    Returns {}

Const escapeIdType

  • escapeIdType(id: any): string

Const extractBaseType

  • extractBaseType<T>(type: IntrospectionListTypeRef<T> | T): any
  • Type parameters

    • T: IntrospectionTypeRef

    Parameters

    • type: IntrospectionListTypeRef<T> | T

    Returns any

Const extractFromList

  • extractFromList<T>(type: IntrospectionListTypeRef<T> | T): T
  • Type parameters

    • T: IntrospectionTypeRef

    Parameters

    • type: IntrospectionListTypeRef<T> | T

    Returns T

Const extractFromNonNull

  • extractFromNonNull<T>(type: IntrospectionNonNullTypeRef<T> | T): T
  • Type parameters

    • T: IntrospectionTypeRef

    Parameters

    • type: IntrospectionNonNullTypeRef<T> | T

    Returns T

Const factory

  • factory<T>(client: ApolloClient<T>, options?: ProviderOptions, graphqlProviderOptions?: Omit<Options, "client" | "buildQuery">): Promise<DataProvider>
  • Type parameters

    • T

    Parameters

    • client: ApolloClient<T>
    • Optional options: ProviderOptions
    • Optional graphqlProviderOptions: Omit<Options, "client" | "buildQuery">

    Returns Promise<DataProvider>

Const fieldIsObjectOrListOfObject

  • fieldIsObjectOrListOfObject(field: any): boolean

Const findTypeByName

  • findTypeByName(type: IntrospectionType, name: string | undefined): undefined | IntrospectionField
  • Parameters

    • type: IntrospectionType
    • name: string | undefined

    Returns undefined | IntrospectionField

Const formatArgumentsAsQuery

  • formatArgumentsAsQuery(obj: any, level?: number): string | number
  • Parameters

    • obj: any
    • Default value level: number = 0

    Returns string | number

Const getManyReference

  • getManyReference(params: GetManyReferenceParams, type: IntrospectionType, manyLowerResourceName: string, resourceTypename: string, pluralizedResourceTypeName: string, typeMap: TypeMap, queryMap: QueryMap, typeConfiguration: TypeConfigMap, primaryKey: PrimaryKey, fetchQueryType: FetchQueryType): { query: DocumentNode; parseResponse: any; variables: object }
  • Parameters

    • params: GetManyReferenceParams
    • type: IntrospectionType
    • manyLowerResourceName: string
    • resourceTypename: string
    • pluralizedResourceTypeName: string
    • typeMap: TypeMap
    • queryMap: QueryMap
    • typeConfiguration: TypeConfigMap
    • primaryKey: PrimaryKey
    • fetchQueryType: FetchQueryType

    Returns { query: DocumentNode; parseResponse: any; variables: object }

    • query: DocumentNode
    • parseResponse: function
      • parseResponse(response: Response): { data: any; total: any }
    • variables: object
      • filter: undefined | FilterMap
      • first: number
      • offset: number
      • orderBy: string[]

Const hasOthersThenNaturalOrdering

  • hasOthersThenNaturalOrdering(typeMap: TypeMap, orderingArgument: IntrospectionListTypeRef<IntrospectionNonNullTypeRef<IntrospectionNamedTypeRef>> | undefined): undefined | false | true | ""
  • Parameters

    • typeMap: TypeMap
    • orderingArgument: IntrospectionListTypeRef<IntrospectionNonNullTypeRef<IntrospectionNamedTypeRef>> | undefined

    Returns undefined | false | true | ""

Const lowercase

  • lowercase(str: string): string

makeQueryRunner

  • makeQueryRunner(connectionString?: string, schemaName?: string, options?: { appendPlugins: any[] }): Promise<{ apolloClient: ApolloClient<NormalizedCacheObject>; release: release; schema: IntrospectionSchema }>
  • Parameters

    • Default value connectionString: string = process.env.DATABASE_URL || 'postgres:///'
    • Default value schemaName: string = process.env.DATABASE_SCHEMA || 'app_public'
    • Default value options: { appendPlugins: any[] } = {appendPlugins: [PgSimplifyInflectorPlugin, PgConnectionFilterPlugin],}
      • appendPlugins: any[]

    Returns Promise<{ apolloClient: ApolloClient<NormalizedCacheObject>; release: release; schema: IntrospectionSchema }>

Const mapFilterType

  • mapFilterType(type: IntrospectionNamedTypeRef, value: any, key: string): Filter | undefined
  • Transforms for a certain field type a search value for a field (the key) to a filter that is understood by postgraphile.

    For example:

    • type: {kind: "SCALAR", name: "String", ofType: null, typename: "Type"}
    • value: "some keyword"
    • key: "name"

    Is transformed to:

    {
      name: {
        includes: "some keyword"
      }
    }

    Parameters

    • type: IntrospectionNamedTypeRef
    • value: any
    • key: string

    Returns Filter | undefined

Const mapInputToVariables

  • mapInputToVariables(input: any, inputType: any, type: any, typeConfiguration: TypeConfigMap): any

Const mapType

  • mapType(idType: IntrospectionNamedTypeRef<any>, value: string | number, typeConfigMap?: TypeConfigMap): any

Const preparePrimaryKey

  • preparePrimaryKey(query: Query | undefined, resourceName: string, resourceTypename: string, type: IntrospectionType): PrimaryKey

Const queryHasArgument

  • queryHasArgument(type: string, argument: string, queryMap: QueryMap): IntrospectionInputValue | undefined
  • Parameters

    • type: string
    • argument: string
    • queryMap: QueryMap

    Returns IntrospectionInputValue | undefined

Const shouldQueryField

Const snake

  • snake(camelCaseInput: string): string
  • Parameters

    • camelCaseInput: string

    Returns string

Const stripUndefined

  • stripUndefined<T>(variables: T): {}
  • Type parameters

    • T: Record<string, any>

    Parameters

    • variables: T

    Returns {}

Object literals

Const buildInTypeConfig

buildInTypeConfig: object

GeographyPoint

GeographyPoint: object

expand

expand: true = true

queryValueToInputValue

  • queryValueToInputValue(value: { geojson: GeoJSON; type: string }): GeoJSON

GeometryGeometry

GeometryGeometry: object

expand

expand: true = true

queryValueToInputValue

  • queryValueToInputValue(value: { geojson: GeoJSON; type: string }): GeoJSON

GeometryPoint

GeometryPoint: object

expand

expand: true = true

queryValueToInputValue

  • queryValueToInputValue(value: { geojson: GeoJSON; type: string }): GeoJSON

Generated using TypeDoc