Skip to content

Commit

Permalink
docs: add addResolvers example
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Sep 27, 2024
1 parent de20646 commit 6823bba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ After your test run, you can destroy the instance with `destroy`.
```ts
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
import type { MoquerieInstance } from 'moquerie'
import { createTestInstance, startServer, useSnapshot } from 'moquerie'
import { addResolvers, createTestInstance, startServer, useSnapshot } from 'moquerie'

describe('fetch', () => {
let mq: MoquerieInstance
Expand Down Expand Up @@ -846,6 +846,12 @@ describe('fetch', () => {
})

it('should fetch REST', async () => {
// await addResolvers(mq, {
// Query: {
// hello: () => 'world',
// },
// })

{
const response = await fetch(`http://localhost:${port}/rest/my-object`)
const data = await response.json()
Expand Down

0 comments on commit 6823bba

Please sign in to comment.