Skip to content

Commit

Permalink
Update testing.mdx, fix Mutation and Query Operations example (#3438)
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterchainstarters authored Sep 23, 2024
1 parent 9781eb7 commit fbe0beb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions website/src/pages/docs/features/testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ function assertSingleValue<TValue extends object>(
}
}

const yoga = createYoga({ schema })

const executor = buildHTTPExecutor({
fetch: yoga.fetch
fetch: yoga.fetch,
endpoint: `http://yoga/graphql`,
})

const result = await executor({
Expand All @@ -97,8 +100,9 @@ assertSingleValue(result)

console.assert(
result.data?.greetings === 'Hello World!',
`Expected 'Hello World!' but got ${executionResult.data.greetings}`
`Expected 'Hello World!' but got ${result.data.greetings}`
)

```

### Subscription Operations
Expand Down

0 comments on commit fbe0beb

Please sign in to comment.