From 49746d6b4928acb01967b72020770cdaae521267 Mon Sep 17 00:00:00 2001 From: Saihajpreet Singh Date: Sun, 1 Aug 2021 11:25:10 -0400 Subject: [PATCH] remove unused types --- src/connection/connection.ts | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/src/connection/connection.ts b/src/connection/connection.ts index 8eca198..4cd30af 100644 --- a/src/connection/connection.ts +++ b/src/connection/connection.ts @@ -10,68 +10,48 @@ import { import type { GraphQLNamedType, - GraphQLScalarType, - GraphQLFieldConfigArgumentMap, GraphQLFieldConfigMap, GraphQLFieldResolver, Thunk, } from 'graphql'; -interface ForwardConnectionArgs { - after: { type: GraphQLScalarType }; - first: { type: GraphQLScalarType }; -} - /** * Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field * whose return type is a connection type with forward pagination. */ -export const forwardConnectionArgs: ForwardConnectionArgs & - GraphQLFieldConfigArgumentMap = { +export const forwardConnectionArgs = { after: { type: GraphQLString, - // @ts-expect-error FIXME description: 'Returns the items in the list that come after the specified cursor.', }, first: { type: GraphQLInt, - // @ts-expect-error FIXME description: 'Returns the first n items from the list.', }, -}; - -interface BackwardConnectionArgs { - before: { type: GraphQLScalarType }; - last: { type: GraphQLScalarType }; -} +} as const; /** * Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field * whose return type is a connection type with backward pagination. */ -export const backwardConnectionArgs: BackwardConnectionArgs & - GraphQLFieldConfigArgumentMap = { +export const backwardConnectionArgs = { before: { type: GraphQLString, - // @ts-expect-error FIXME description: 'Returns the items in the list that come before the specified cursor.', }, last: { type: GraphQLInt, - // @ts-expect-error FIXME description: 'Returns the last n items from the list.', }, -}; +} as const; /** * Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field * whose return type is a connection type with bidirectional pagination. */ -export const connectionArgs: BackwardConnectionArgs & - ForwardConnectionArgs & - GraphQLFieldConfigArgumentMap = { +export const connectionArgs = { ...forwardConnectionArgs, ...backwardConnectionArgs, }; @@ -170,7 +150,7 @@ export interface Connection { /** * A type designed to be exposed as a `Edge` over GraphQL. */ -interface Edge { +export interface Edge { node: T; cursor: ConnectionCursor; } @@ -204,7 +184,7 @@ const pageInfoType = new GraphQLObjectType({ /** * A type designed to be exposed as `PageInfo` over GraphQL. */ -interface PageInfo { +export interface PageInfo { startCursor: ConnectionCursor | null; endCursor: ConnectionCursor | null; hasPreviousPage: boolean;