From 5b428507ef246be7ca3afb3589c410874a57f9bc Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Thu, 25 Jun 2020 17:42:47 +0300 Subject: [PATCH] Use graphql's predicate function instead of `instanceof` (#270) --- src/node/plural.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/plural.js b/src/node/plural.js index fa5625e..d342ff3 100644 --- a/src/node/plural.js +++ b/src/node/plural.js @@ -1,6 +1,6 @@ // @flow strict -import { GraphQLList, GraphQLNonNull } from 'graphql'; +import { GraphQLList, GraphQLNonNull, isNonNullType } from 'graphql'; import type { GraphQLFieldConfig, @@ -26,7 +26,7 @@ export function pluralIdentifyingRootField( ): GraphQLFieldConfig { const inputArgs = {}; let inputType = config.inputType; - if (inputType instanceof GraphQLNonNull) { + if (isNonNullType(inputType)) { inputType = inputType.ofType; } inputArgs[config.argName] = {