Skip to content

Commit 9ae34cf

Browse files
committed
added a test to explicitly check if the for the buildTypeWeights to not throw an error when enforce unbounded lists is false
1 parent b0bfce0 commit 9ae34cf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/analysis/buildTypeWeights.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,12 @@ describe('Test buildTypeWeightsFromSchema function', () => {
12641264
);
12651265
});
12661266

1267+
test('there is an unbounded list and user chooses to not enforce bounded lists', () => {
1268+
expect(() => buildTypeWeightsFromSchema(schema, {}, false)).not.toThrowError(
1269+
'ERROR: buildTypeWeights: Use directive @listCost(cost: Int!) on unbounded lists, or limit query results with first,last,limit'
1270+
);
1271+
});
1272+
12671273
// TODO: throw validation error if schema is invalid
12681274
xtest('schema is invalid', () => {});
12691275
});

0 commit comments

Comments
 (0)