Skip to content

Commit 10fdf8b

Browse files
authored
Merge pull request #1 from graphile/more-tests
2 parents 5e959df + 289059f commit 10fdf8b

16 files changed

+14186
-26
lines changed

__tests__/countDepth.test.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { it } from "node:test";
33
import assert from "node:assert";
44
import { parse, Kind, getOperationAST } from "graphql";
55
import { countDepth } from "../dist/index.js";
6-
import { schema } from "./utils.mjs";
6+
import { getSchema } from "./utils.mjs";
77

88
const query = /* GraphQL */ `
99
query FriendsOfFriends {
@@ -19,7 +19,7 @@ const query = /* GraphQL */ `
1919
}
2020
`;
2121

22-
it("works as in README", () => {
22+
it("works as in README", async () => {
2323
const document = parse(query);
2424
const operationName = undefined;
2525
const fragments = document.definitions.filter(
@@ -32,6 +32,7 @@ it("works as in README", () => {
3232
`Could not determine operation, please check the operationName`,
3333
);
3434
}
35+
const schema = await getSchema();
3536
const { depths, resolvedOptions } = countDepth(schema, operation, fragments, {
3637
// Options here
3738
});

0 commit comments

Comments
 (0)