From 845b4f4ae76d143d6aae0e7a6117cb342f6f053a Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 29 Apr 2024 11:03:54 +0100 Subject: [PATCH] Use the new grafast signature --- grafast/grafast/__tests__/trap-test.ts | 72 ++++++++++++-------------- 1 file changed, 32 insertions(+), 40 deletions(-) diff --git a/grafast/grafast/__tests__/trap-test.ts b/grafast/grafast/__tests__/trap-test.ts index 1fec49f579..e6dac60fc8 100644 --- a/grafast/grafast/__tests__/trap-test.ts +++ b/grafast/grafast/__tests__/trap-test.ts @@ -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"]); @@ -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 }); }); @@ -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: [] }); }); @@ -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,