diff --git a/types/graphql-relay/index.d.ts b/types/graphql-relay/index.d.ts index fc1eb3aa1e..842e1ad4f1 100644 --- a/types/graphql-relay/index.d.ts +++ b/types/graphql-relay/index.d.ts @@ -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 { * 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( * otherwise it will be the default. */ export function getOffsetWithDefault( - cursor?: ConnectionCursor, - defaultOffset?: number + cursor?: ConnectionCursor | null, + defaultOffset?: number | null ): number; // mutation/mutation.js