typegraphql-relay-connections
Classes​
- BackwardPaginationArgs
- ForwardPaginationArgs
- FullPaginationArgs
- PageInfo
- RelayConnectionType
- RelayEdgeType
Interfaces​
References​
CursorScalar​
Renames and re-exports Cursor
Type Aliases​
ClassReturnType​
Ƭ ClassReturnType<T
>: T
extends ClassType
<infer J> ? J
: never
Type parameters​
Name | Type |
---|---|
T | extends ClassType <unknown > |
Defined in​
NodesType​
Ƭ NodesType: unknown
Defined in​
NodesTypeClass​
Ƭ NodesTypeClass: ClassType
<NodesType
>
Defined in​
Variables​
Cursor​
• Cursor: GraphQLScalarType
Defined in​
Functions​
ConnectionType​
â–¸ ConnectionType<CursorType
, EdgeType
>(edge
): ClassType
<RelayConnectionType
<CursorType
, EdgeType
>>
Setup an extensible ConnectionType
Type parameters​
Name | Type |
---|---|
CursorType | extends Cursor = Cursor |
EdgeType | extends RelayEdgeType <CursorType , unknown , EdgeType > = RelayEdgeType <CursorType , unknown > |
Parameters​
Name | Type |
---|---|
edge | ClassType <EdgeType > | HasConstructor <EdgeType > |
Returns​
ClassType
<RelayConnectionType
<CursorType
, EdgeType
>>
A graphql object type that represents fields that can be queried.
Example
Usage:
@ObjectType()
class Item {
@Field()
id!: number;
}
@ObjectType()
export class ItemEdge extends EdgeType(Item) {}
// You must create an edge type first
@ObjectType()
export class ItemConnection extends ConnectionType(ItemEdge) {}
Defined in​
EdgeType​
â–¸ EdgeType<CursorType
, NodeType
>(nodeType
): ClassType
<RelayEdgeType
<CursorType
, NodeType
>>
Setup a extensible EdgeType
Type parameters​
Name | Type |
---|---|
CursorType | extends Cursor = Cursor |
NodeType | extends unknown = unknown |
Parameters​
Name | Type |
---|---|
nodeType | ClassType <NodeType > | HasConstructor <NodeType > |
Returns​
ClassType
<RelayEdgeType
<CursorType
, NodeType
>>
A graphql object type that represents fields that can be queried.
Example
Usage:
// create an object type
@ObjectType()
class Item {
@Field()
id!: number;
}
// Create your extensible Edge type
@ObjectType()
export class ItemEdge extends EdgeType(Item) {
// add additional properties here
@Field(() => Date)
createdAt: Date
}
Defined in​
deserializeCursor​
â–¸ deserializeCursor(externalCursor
): Cursor
The external cursor is the value the cursor will be after it comes from the graphql client.
Parameters​
Name | Type | Description |
---|---|---|
externalCursor | string | The serialized cursor that most that was just received from the client. |
Returns​
The full deserialized, decoded, and parsed cursor.
Defined in​
serializeCursor​
â–¸ serializeCursor(internalCursor
): string
The serialized cursor is the value the cursor will be so it may arrive at the graphql client and be sent through a network. In this case the type is an opaque base64 string.
Parameters​
Name | Type | Description |
---|---|---|
internalCursor | Cursor | The full unencoded and parsed cursor. |
Returns​
string
The encoded cursor ready to be sent to the client.