mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge pull request #28424 from joonhocho/patch-1
graphql-relay/index.d.ts: after, before, first, last can be null or undefined
This commit is contained in:
Vendored
+18
-18
@@ -34,12 +34,12 @@ import {
|
||||
* whose return type is a connection type with forward pagination.
|
||||
*/
|
||||
export interface ForwardConnectionArgs {
|
||||
after: ConnectionCursor;
|
||||
first: number;
|
||||
after?: ConnectionCursor | null;
|
||||
first?: number | null;
|
||||
}
|
||||
export const forwardConnectionArgs: GraphQLFieldConfigArgumentMap & {
|
||||
after: ConnectionCursor;
|
||||
first: number;
|
||||
after?: ConnectionCursor | null;
|
||||
first?: number | null;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -47,12 +47,12 @@ export const forwardConnectionArgs: GraphQLFieldConfigArgumentMap & {
|
||||
* whose return type is a connection type with backward pagination.
|
||||
*/
|
||||
export interface BackwardConnectionArgs {
|
||||
before: ConnectionCursor;
|
||||
last: number;
|
||||
before?: ConnectionCursor | null;
|
||||
last?: number | null;
|
||||
}
|
||||
export const backwardConnectionArgs: GraphQLFieldConfigArgumentMap & {
|
||||
before: ConnectionCursor;
|
||||
last: number;
|
||||
before?: ConnectionCursor | null;
|
||||
last?: number | null;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -105,10 +105,10 @@ export type ConnectionCursor = string;
|
||||
* A flow type designed to be exposed as `PageInfo` over GraphQL.
|
||||
*/
|
||||
export interface PageInfo {
|
||||
startCursor: ConnectionCursor;
|
||||
endCursor: ConnectionCursor;
|
||||
hasPreviousPage: boolean;
|
||||
hasNextPage: boolean;
|
||||
startCursor?: ConnectionCursor | null;
|
||||
endCursor?: ConnectionCursor | null;
|
||||
hasPreviousPage?: boolean | null;
|
||||
hasNextPage?: boolean | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -131,10 +131,10 @@ export interface Edge<T> {
|
||||
* A flow type describing the arguments a connection field receives in GraphQL.
|
||||
*/
|
||||
export interface ConnectionArguments {
|
||||
before?: ConnectionCursor;
|
||||
after?: ConnectionCursor;
|
||||
first?: number;
|
||||
last?: number;
|
||||
before?: ConnectionCursor | null;
|
||||
after?: ConnectionCursor | null;
|
||||
first?: number | null;
|
||||
last?: number | null;
|
||||
}
|
||||
|
||||
// connection/arrayconnection.js
|
||||
@@ -212,8 +212,8 @@ export function cursorForObjectInConnection<T>(
|
||||
* otherwise it will be the default.
|
||||
*/
|
||||
export function getOffsetWithDefault(
|
||||
cursor?: ConnectionCursor,
|
||||
defaultOffset?: number
|
||||
cursor?: ConnectionCursor | null,
|
||||
defaultOffset?: number | null
|
||||
): number;
|
||||
|
||||
// mutation/mutation.js
|
||||
|
||||
Reference in New Issue
Block a user