Function
Static Public Summary | ||
public |
addPaginationArguments(field: *) |
|
public |
applyCustomDirectives(field: *) |
|
public |
argumentsToObject(argumentsAst: *): * |
|
public |
buildArgument(name: *, type: *): {"kind": string, "name": *, "type": *, "defaultValue": *, "directives": *} |
|
public |
buildBaseQuery(args: object): object sets find(queryObject) with provided baseQuery plus additional filters |
|
public |
buildField(name: *, args: *, typeName: *): {"kind": string, "name": *, "arguments": *, "type": *} |
|
public |
buildFilterQuery(args: any): any |
|
public |
buildLimit(args: any): number |
|
public |
|
|
public |
reads and graphql file and returns it as a string |
|
public |
|
|
public |
buildSortQuery(args: object): object sets the sort query for .sort(keyOrList, direction) |
|
public |
buildTypeDefinition(name: *, fields: *, kind: *, values: *): {"kind": *, "name": *, "interfaces": *, "directives": *, "fields": *, "values": *} |
|
public |
buildTypeExtension(type: *): {"kind": *, "definition": *} |
|
public |
buildTypeReference(name: *): {"kind": string, "name": *} |
|
public |
buildValue(name: *, args: *): {"kind": string, "name": *, "arguments": *} |
|
public |
enhanceSchemaWithQueryArguments(inputSchema: object): object prepares the schema for the additional query arguments types |
|
public |
getBaseType(type: *): * |
|
public |
|
|
public |
|
|
public |
idArgument(): * |
|
public |
isScalarField(field: *): * |
|
public |
prepareQueries(args: any): object |
|
public |
reads a .graphql file and parses the file |
|
public |
readString(path: string): string reads a .graphql file |
|
public |
|
|
public |
sendQueryAndExpect(query: string, expectedResult: any, userId: string): any |
|
public |
templateToAst(template: string, replacements: string): object Take a template, replacing each replacement. |
Static Private Summary | ||
private |
converts first character of string to lower case |
|
private |
converts first character of string to upper case |
Static Public
public addPaginationArguments(field: *) source
import {addPaginationArguments} from 'create-graphql-server-query-arguments/src/util/graphql.js'
Params:
Name | Type | Attribute | Description |
field | * |
public applyCustomDirectives(field: *) source
import {applyCustomDirectives} from 'create-graphql-server-query-arguments/src/util/graphql.js'
Params:
Name | Type | Attribute | Description |
field | * |
public argumentsToObject(argumentsAst: *): * source
import {argumentsToObject} from 'create-graphql-server-query-arguments/src/util/graphql.js'
Params:
Name | Type | Attribute | Description |
argumentsAst | * |
Return:
* |
public buildArgument(name: *, type: *): {"kind": string, "name": *, "type": *, "defaultValue": *, "directives": *} source
import {buildArgument} from 'create-graphql-server-query-arguments/src/util/graphql.js'
Params:
Name | Type | Attribute | Description |
name | * | ||
type | * |
public buildBaseQuery(args: object): object source
import {buildBaseQuery} from 'create-graphql-server-query-arguments/src/model/buildBaseQuery.js'
sets find(queryObject) with provided baseQuery plus additional filters
Params:
Name | Type | Attribute | Description |
args | object | query arguments for the .find() method |
public buildField(name: *, args: *, typeName: *): {"kind": string, "name": *, "arguments": *, "type": *} source
import {buildField} from 'create-graphql-server-query-arguments/src/util/graphql.js'
Params:
Name | Type | Attribute | Description |
name | * | ||
args | * | ||
typeName | * |
public buildFilterQuery(args: any): any source
import {buildFilterQuery} from 'create-graphql-server-query-arguments/src/model/buildFilterQuery.js'
Params:
Name | Type | Attribute | Description |
args | any |
Return:
any |
public buildLimit(args: any): number source
import {buildLimit} from 'create-graphql-server-query-arguments/src/model/buildLimit.js'
Params:
Name | Type | Attribute | Description |
args | any |
public buildName(name: *): {"kind": string, "value": *} source
import {buildName} from 'create-graphql-server-query-arguments/src/util/graphql.js'
Params:
Name | Type | Attribute | Description |
name | * |
public buildRequiredTypes(): string source
import {buildRequiredTypes} from 'create-graphql-server-query-arguments/src/schema/buildRequiredTypes.js'
reads and graphql file and returns it as a string
public buildSkip(args: any): number source
import {buildSkip} from 'create-graphql-server-query-arguments/src/model/buildSkip.js'
Params:
Name | Type | Attribute | Description |
args | any |
public buildSortQuery(args: object): object source
import {buildSortQuery} from 'create-graphql-server-query-arguments/src/model/buildSortQuery.js'
sets the sort query for .sort(keyOrList, direction)
Params:
Name | Type | Attribute | Description |
args | object | query arguments for the .find() method |
public buildTypeDefinition(name: *, fields: *, kind: *, values: *): {"kind": *, "name": *, "interfaces": *, "directives": *, "fields": *, "values": *} source
import {buildTypeDefinition} from 'create-graphql-server-query-arguments/src/util/graphql.js'
Params:
Name | Type | Attribute | Description |
name | * | ||
fields | * | ||
kind | * | ||
values | * |
Return:
{"kind": *, "name": *, "interfaces": *, "directives": *, "fields": *, "values": *} |
public buildTypeExtension(type: *): {"kind": *, "definition": *} source
import {buildTypeExtension} from 'create-graphql-server-query-arguments/src/util/graphql.js'
Params:
Name | Type | Attribute | Description |
type | * |
Return:
{"kind": *, "definition": *} |
public buildTypeReference(name: *): {"kind": string, "name": *} source
import {buildTypeReference} from 'create-graphql-server-query-arguments/src/util/graphql.js'
Params:
Name | Type | Attribute | Description |
name | * |
public buildValue(name: *, args: *): {"kind": string, "name": *, "arguments": *} source
import {buildValue} from 'create-graphql-server-query-arguments/src/util/graphql.js'
Params:
Name | Type | Attribute | Description |
name | * | ||
args | * |
public enhanceSchemaWithQueryArguments(inputSchema: object): object source
import {enhanceSchemaWithQueryArguments} from 'create-graphql-server-query-arguments/src/schema/enhanceSchemaWithQueryArguments.js'
prepares the schema for the additional query arguments types
Params:
Name | Type | Attribute | Description |
inputSchema | object | the input's schema with all fields |
public getBaseType(type: *): * source
import {getBaseType} from 'create-graphql-server-query-arguments/src/util/graphql.js'
Params:
Name | Type | Attribute | Description |
type | * |
Return:
* |
public getToken(userId: string, undefined: *): union source
import {getToken} from 'create-graphql-server-query-arguments/src/sendQuery.js'
Params:
Name | Type | Attribute | Description |
userId | string | ||
undefined | * |
Return:
union |
public getType(level: *): string source
import {getType} from 'create-graphql-server-query-arguments/src/util/graphql.js'
Params:
Name | Type | Attribute | Description |
level | * |
public idArgument(): * source
import {idArgument} from 'create-graphql-server-query-arguments/src/util/graphql.js'
Return:
* |
public isScalarField(field: *): * source
import {isScalarField} from 'create-graphql-server-query-arguments/src/util/graphql.js'
Params:
Name | Type | Attribute | Description |
field | * |
Return:
* |
public prepareQueries(args: any): object source
import {prepareQueries} from 'create-graphql-server-query-arguments/src/model/prepareQueries.js'
Params:
Name | Type | Attribute | Description |
args | any |
public readInput(path: string): object source
import readInput from 'create-graphql-server-query-arguments/src/util/read.js'
reads a .graphql file and parses the file
Params:
Name | Type | Attribute | Description |
path | string | path of the graphql file |
public readString(path: string): string source
import {readString} from 'create-graphql-server-query-arguments/src/util/read.js'
reads a .graphql file
Params:
Name | Type | Attribute | Description |
path | string | path of the graphql file |
public sendQuery(undefined: object): any source
import {sendQuery} from 'create-graphql-server-query-arguments/src/sendQuery.js'
Params:
Name | Type | Attribute | Description |
undefined | object |
Return:
any |
public sendQueryAndExpect(query: string, expectedResult: any, userId: string): any source
import {sendQueryAndExpect} from 'create-graphql-server-query-arguments/src/sendQuery.js'
Return:
any |
public templateToAst(template: string, replacements: string): object source
import {templateToAst} from 'create-graphql-server-query-arguments/src/util/read.js'
Take a template, replacing each replacement.
Static Private
private lcFirst(str: string): string source
import {lcFirst} from 'create-graphql-server-query-arguments/src/util/capitalization.js'
converts first character of string to lower case
Params:
Name | Type | Attribute | Description |
str | string | string |
private ucFirst(str: string): string source
import {ucFirst} from 'create-graphql-server-query-arguments/src/util/capitalization.js'
converts first character of string to upper case
Params:
Name | Type | Attribute | Description |
str | string | string |