Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
akashjain971 committed Nov 5, 2020
1 parent 2ccaff9 commit 6d18781
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/evaluate-script.test.ts
Expand Up @@ -50,9 +50,14 @@ describe(evaluateScript, () => {
const runScript = evaluateScript(`
async function todoTitles({graphql}) {
const results = await graphql('{ queryTodo { title } }')
return results.data.queryTodo.map(t => t.title)
return results?.data?.queryTodo.map(t => t.title)
}
addGraphQLResolvers({ "Query.todoTitles": todoTitles })`)





const results = await runScript({ type: "Query.todoTitles", args: {}, parents: null });
expect(new Set(results)).toEqual(new Set(["Kick Ass", "Chew Bubblegum"]))
})
Expand Down

0 comments on commit 6d18781

Please sign in to comment.