Skip to content

Commit 01567c0

Browse files
committed
Remove 'assert'
1 parent e3c647d commit 01567c0

File tree

1 file changed

+3
-2
lines changed
  • packages/graphql-parse-resolve-info/src

1 file changed

+3
-2
lines changed

packages/graphql-parse-resolve-info/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import * as assert from "assert";
21
import {
32
getNamedType,
43
isCompositeType,
@@ -270,7 +269,9 @@ function fieldTreeFromAST<T extends SelectionNode>(
270269
if (DEBUG_ENABLED)
271270
debug("%s[%d] Fragment spread '%s'", depth, instance, name);
272271
const fragment = fragments[name];
273-
assert(fragment, 'unknown fragment "' + name + '"');
272+
if (!fragment) {
273+
throw new Error('unknown fragment "' + name + '"');
274+
}
274275
let fragmentType: GraphQLNamedType | null | undefined = parentType;
275276
if (fragment.typeCondition) {
276277
fragmentType = getType(resolveInfo, fragment.typeCondition);

0 commit comments

Comments
 (0)