From 7e922536bceb5b9970af655aaaba6b91b0f690cb Mon Sep 17 00:00:00 2001 From: productdevbook Date: Tue, 7 Nov 2023 12:53:45 +0300 Subject: [PATCH] feat: error in parseCurserArgs function --- src/relay.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/relay.ts b/src/relay.ts index 4a8de7b..7c12c74 100644 --- a/src/relay.ts +++ b/src/relay.ts @@ -136,6 +136,9 @@ function parseCurserArgs(options: ResolveOffsetConnectionOptions) { const defaultSize = options.defaultSize ?? DEFAULT_SIZE const maxSize = options.maxSize ?? DEFAULT_MAX_SIZE + if (before && after) + throw new Error('Arguments "before" and "after" cannot be used together') + if (first != null && first < 0) throw new Error('Argument "first" must be a non-negative integer')