We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e3c647d commit 01567c0Copy full SHA for 01567c0
packages/graphql-parse-resolve-info/src/index.ts
@@ -1,4 +1,3 @@
1
-import * as assert from "assert";
2
import {
3
getNamedType,
4
isCompositeType,
@@ -270,7 +269,9 @@ function fieldTreeFromAST<T extends SelectionNode>(
270
269
if (DEBUG_ENABLED)
271
debug("%s[%d] Fragment spread '%s'", depth, instance, name);
272
const fragment = fragments[name];
273
- assert(fragment, 'unknown fragment "' + name + '"');
+ if (!fragment) {
+ throw new Error('unknown fragment "' + name + '"');
274
+ }
275
let fragmentType: GraphQLNamedType | null | undefined = parentType;
276
if (fragment.typeCondition) {
277
fragmentType = getType(resolveInfo, fragment.typeCondition);
0 commit comments