Skip to content

Commit 61413f2

Browse files
committed
fix: check TypeComposer via class name
1 parent be62b52 commit 61413f2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/composeWithPagination.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function composeWithPagination(
1313
typeComposer: TypeComposer,
1414
opts: ComposeWithPaginationOpts
1515
): TypeComposer {
16-
if (!(typeComposer instanceof TypeComposer)) {
16+
if (!typeComposer || typeComposer.constructor.name !== 'TypeComposer') {
1717
throw new Error('You should provide TypeComposer instance to composeWithPagination method');
1818
}
1919

src/paginationResolver.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function preparePaginationResolver<TSource, TContext>(
4343
typeComposer: TypeComposer,
4444
opts: ComposeWithPaginationOpts
4545
): Resolver<TSource, TContext> {
46-
if (!(typeComposer instanceof TypeComposer)) {
46+
if (!typeComposer || typeComposer.constructor.name !== 'TypeComposer') {
4747
throw new Error('First arg for prepareConnectionResolver() should be instance of TypeComposer');
4848
}
4949

0 commit comments

Comments
 (0)