Properties
clearCache
clearCache: (() => Promise<void>)
Type declaration
-
- (): Promise<void>
-
Returns Promise<void>
findByPkForGraphQL
find
By
Pk
For
GraphQL
: (<M>(this
: SGModelCtrl<M>, id
: string | number, options
: FindOptions<any>, context
: SGResolveContext, info
: GraphQLResolveInfo, path
?: string) => Promise<M | null>)
Type declaration
-
- <M>(this: SGModelCtrl<M>, id: string | number, options: FindOptions<any>, context: SGResolveContext, info: GraphQLResolveInfo, path?: string): Promise<M | null>
-
Parameters
-
-
id: string | number
-
options: FindOptions<any>
-
-
info: GraphQLResolveInfo
-
Optional
path: string
Returns Promise<M | null>
findOneForGraphQL
find
One
For
GraphQL
: (<M>(this
: SGModelCtrl<M>, options
: FindOptions<any>, context
: any, info
: GraphQLResolveInfo, path
?: string) => Promise<M | null>)
Type declaration
-
- <M>(this: SGModelCtrl<M>, options: FindOptions<any>, context: any, info: GraphQLResolveInfo, path?: string): Promise<M | null>
-
Parameters
-
-
options: FindOptions<any>
-
context: any
-
info: GraphQLResolveInfo
-
Optional
path: string
Returns Promise<M | null>
hasSelection
has
Selection
: (<M>(this
: SGModelCtrl<M>, args
: { info
?: GraphQLResolveInfo; path
: string; }) => boolean)
Type declaration
-
- <M>(this: SGModelCtrl<M>, args: {
info?: GraphQLResolveInfo;
path: string;
}): boolean
-
Parameters
-
-
args: {
info?: GraphQLResolveInfo;
path: string;
}
-
Optional
info?: GraphQLResolveInfo
-
path: string
Returns boolean
parseAttributes
parse
Attributes
: (<M>(this
: SGModelCtrl<M>, args
: { attributes
: string[]; selections
?: Selection[]; }) => { additionSelections
: Selection[]; attributes
: string[]; })
Type declaration
-
- <M>(this: SGModelCtrl<M>, args: {
attributes: string[];
selections?: Selection[];
}): {
additionSelections: Selection[];
attributes: string[];
}
-
Parameters
-
-
args: {
attributes: string[];
selections?: Selection[];
}
-
attributes: string[]
-
Optional
selections?: Selection[]
Returns {
additionSelections: Selection[];
attributes: string[];
}
-
additionSelections: Selection[]
-
attributes: string[]
parseSelections
parseSelections: ((fragments: {
[key: string]: FragmentDefinitionNode;
}, selections?: readonly SelectionNode[], base?: {
namedType: string;
}) => Selection[])
Type declaration
-
- (fragments: {
[key: string]: FragmentDefinitionNode;
}, selections?: readonly SelectionNode[], base?: {
namedType: string;
}): Selection[]
-
Parameters
-
fragments: {
[key: string]: FragmentDefinitionNode;
}
-
[key: string]: FragmentDefinitionNode
-
Optional
selections: readonly SelectionNode[]
-
Optional
base: {
namedType: string;
}
Returns Selection[]
resolveQueryOption
resolve
Query
Option
: (<M>(this
: SGModelCtrl<M>, args
: { attributes
?: string[]; eagerHasMany
?: boolean; include
?: Includeable | Includeable[]; info
?: GraphQLResolveInfo; order
?: Order; path
?: string; }) => { attributes
: string[]; include
: Includeable | Includeable[]; order
: OrderItem[]; })
Type declaration
-
- <M>(this: SGModelCtrl<M>, args: {
attributes?: string[];
eagerHasMany?: boolean;
include?: Includeable | Includeable[];
info?: GraphQLResolveInfo;
order?: Order;
path?: string;
}): {
attributes: string[];
include: Includeable | Includeable[];
order: OrderItem[];
}
-
Parameters
-
-
args: {
attributes?: string[];
eagerHasMany?: boolean;
include?: Includeable | Includeable[];
info?: GraphQLResolveInfo;
order?: Order;
path?: string;
}
-
Optional
attributes?: string[]
-
Optional
eagerHasMany?: boolean
-
Optional
include?: Includeable | Includeable[]
-
Optional
info?: GraphQLResolveInfo
-
Optional
order?: Order
-
Optional
path?: string
Returns {
attributes: string[];
include: Includeable | Includeable[];
order: OrderItem[];
}
-
attributes: string[]
-
include: Includeable | Includeable[]
-
order: OrderItem[]
resolveRelayConnection
resolve
Relay
Connection
: (<M>(this
: SGModelCtrl<M>, args
: { attributes
?: string[]; bind
?: BindOrReplacements; include
?: Includeable | Includeable[]; order
?: OrderItem[]; pagination
?: { after
?: string; before
?: string; first
?: number; last
?: number; }; selectionInfo
?: GraphQLResolveInfo; subQuery
?: boolean; where
?: WhereOptions<any>; }) => Promise<{ count
: number; edges
: { cursor
: string | number; node
: M; }[]; pageInfo
: { endCursor
: string | number; hasNextPage
: boolean; hasPreviousPage
: boolean; startCursor
: string | number; }; }>)
Type declaration
-
- <M>(this: SGModelCtrl<M>, args: {
attributes?: string[];
bind?: BindOrReplacements;
include?: Includeable | Includeable[];
order?: OrderItem[];
pagination?: {
after?: string;
before?: string;
first?: number;
last?: number;
};
selectionInfo?: GraphQLResolveInfo;
subQuery?: boolean;
where?: WhereOptions<any>;
}): Promise<{
count: number;
edges: {
cursor: string | number;
node: M;
}[];
pageInfo: {
endCursor: string | number;
hasNextPage: boolean;
hasPreviousPage: boolean;
startCursor: string | number;
};
}>
-
Parameters
-
-
args: {
attributes?: string[];
bind?: BindOrReplacements;
include?: Includeable | Includeable[];
order?: OrderItem[];
pagination?: {
after?: string;
before?: string;
first?: number;
last?: number;
};
selectionInfo?: GraphQLResolveInfo;
subQuery?: boolean;
where?: WhereOptions<any>;
}
-
Optional
attributes?: string[]
-
Optional
bind?: BindOrReplacements
-
Optional
include?: Includeable | Includeable[]
-
Optional
order?: OrderItem[]
-
Optional
pagination?: {
after?: string;
before?: string;
first?: number;
last?: number;
}
-
Optional
after?: string
-
Optional
before?: string
-
Optional
first?: number
-
Optional
last?: number
-
Optional
selectionInfo?: GraphQLResolveInfo
-
Optional
subQuery?: boolean
-
Optional
where?: WhereOptions<any>
Returns Promise<{
count: number;
edges: {
cursor: string | number;
node: M;
}[];
pageInfo: {
endCursor: string | number;
hasNextPage: boolean;
hasPreviousPage: boolean;
startCursor: string | number;
};
}>
withCache
withCache: (<T, M>(this: (new () => M) & typeof Model) => {
count: ((options?: CountOptions<any>) => Promise<number>);
findAll: ((options?: FindOptions<any>) => Promise<M[]>);
findOne: ((options?: FindOptions<any>) => Promise<null | M>);
})
Type declaration
-
- <T, M>(this: (new () => M) & typeof Model): {
count: ((options?: CountOptions<any>) => Promise<number>);
findAll: ((options?: FindOptions<any>) => Promise<M[]>);
findOne: ((options?: FindOptions<any>) => Promise<null | M>);
}
-
Type Parameters
-
T extends {}
-
M extends SGModel<T, M>
Parameters
-
this: (new () => M) & typeof Model
Returns {
count: ((options?: CountOptions<any>) => Promise<number>);
findAll: ((options?: FindOptions<any>) => Promise<M[]>);
findOne: ((options?: FindOptions<any>) => Promise<null | M>);
}
-
count: ((options?: CountOptions<any>) => Promise<number>)
-
- (options?: CountOptions<any>): Promise<number>
-
Parameters
-
Optional
options: CountOptions<any>
Returns Promise<number>
-
findAll: ((options?: FindOptions<any>) => Promise<M[]>)
-
- (options?: FindOptions<any>): Promise<M[]>
-
Parameters
-
Optional
options: FindOptions<any>
Returns Promise<M[]>
-
findOne: ((options?: FindOptions<any>) => Promise<null | M>)
-
- (options?: FindOptions<any>): Promise<null | M>
-
Parameters
-
Optional
options: FindOptions<any>
Returns Promise<null | M>