Skip to content

Commit

Permalink
Use the new grafast signature
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Apr 29, 2024
1 parent c1645b2 commit 845b4f4
Showing 1 changed file with 32 additions and 40 deletions.
72 changes: 32 additions & 40 deletions grafast/grafast/__tests__/trap-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,14 @@ it("schema works as expected", async () => {
}
`;
const variableValues = {};
const result = (await grafast(
{
schema,
source,
variableValues,
contextValue: {},
},
{},
{},
)) as ExecutionResult;
const result = (await grafast({
schema,
source,
variableValues,
contextValue: {},
resolvedPreset: {},
requestContext: {},
})) as ExecutionResult;
expect(result.errors).to.exist;
expect(result.errors).to.have.length(1);
expect(result.errors![0].path).to.deep.equal(["error"]);
Expand All @@ -91,16 +89,14 @@ it("enables trapping an error to null", async () => {
}
`;
const variableValues = {};
const result = (await grafast(
{
schema,
source,
variableValues,
contextValue: {},
},
{},
{},
)) as ExecutionResult;
const result = (await grafast({
schema,
source,
variableValues,
contextValue: {},
resolvedPreset: {},
requestContext: {},
})) as ExecutionResult;
expect(result.errors).to.not.exist;
expect(result.data).to.deep.equal({ nonError: 2, error: null });
});
Expand All @@ -113,16 +109,14 @@ it("enables trapping an error to emptyList", async () => {
}
`;
const variableValues = {};
const result = (await grafast(
{
schema,
source,
variableValues,
contextValue: {},
},
{},
{},
)) as ExecutionResult;
const result = (await grafast({
schema,
source,
variableValues,
contextValue: {},
resolvedPreset: {},
requestContext: {},
})) as ExecutionResult;
expect(result.errors).to.not.exist;
expect(result.data).to.deep.equal({ nonError: [2], error: [] });
});
Expand All @@ -139,16 +133,14 @@ it("enables trapping an error to error", async () => {
}
`;
const variableValues = {};
const result = (await grafast(
{
schema,
source,
variableValues,
contextValue: {},
},
{},
{},
)) as ExecutionResult;
const result = (await grafast({
schema,
source,
variableValues,
contextValue: {},
resolvedPreset: {},
requestContext: {},
})) as ExecutionResult;
expect(result.errors).to.not.exist;
expect(result.data).to.deep.equal({
nonError: null,
Expand Down

0 comments on commit 845b4f4

Please sign in to comment.