Skip to content

Commit

Permalink
fix: #456, export connection plugin args
Browse files Browse the repository at this point in the history
  • Loading branch information
tgriesser committed Nov 27, 2020
1 parent 71ea266 commit 927d4b8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/plugins/connectionPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,26 +298,26 @@ export type ConnectionFieldConfig<TypeName extends string = any, FieldName exten
Pick<CommonFieldConfig, 'deprecation' | 'description'> &
NexusGenPluginFieldConfig<TypeName, FieldName>

const ForwardPaginateArgs = {
export const ForwardPaginateArgs = {
first: nullable(intArg({ description: 'Returns the first n elements from the list.' })),
after: nullable(
stringArg({ description: 'Returns the elements in the list that come after the specified cursor' })
),
}

const ForwardOnlyStrictArgs = {
export const ForwardOnlyStrictArgs = {
...ForwardPaginateArgs,
first: nonNull(intArg({ description: 'Returns the first n elements from the list.' })),
}

const BackwardPaginateArgs = {
export const BackwardPaginateArgs = {
last: nullable(intArg({ description: 'Returns the last n elements from the list.' })),
before: nullable(
stringArg({ description: 'Returns the elements in the list that come before the specified cursor' })
),
}

const BackwardOnlyStrictArgs = {
export const BackwardOnlyStrictArgs = {
...BackwardPaginateArgs,
last: nonNull(intArg({ description: 'Returns the last n elements from the list.' })),
}
Expand Down Expand Up @@ -356,7 +356,7 @@ export type PageInfoFieldResolver<
info: GraphQLResolveInfo
) => MaybePromise<ResultValue<TypeName, FieldName>['pageInfo'][EdgeField]>

type EdgeLike = { cursor: string | PromiseLike<string>; node: any }
export type EdgeLike = { cursor: string | PromiseLike<string>; node: any }

export const connectionPlugin = (connectionPluginConfig?: ConnectionPluginConfig) => {
const pluginConfig: ConnectionPluginConfig = { ...connectionPluginConfig }
Expand Down

0 comments on commit 927d4b8

Please sign in to comment.