diff options
Diffstat (limited to 'tests/msw/handlers/posts/last-post-cursor.handler.ts')
| -rw-r--r-- | tests/msw/handlers/posts/last-post-cursor.handler.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/msw/handlers/posts/last-post-cursor.handler.ts b/tests/msw/handlers/posts/last-post-cursor.handler.ts index 2f4b648..f5c58dc 100644 --- a/tests/msw/handlers/posts/last-post-cursor.handler.ts +++ b/tests/msw/handlers/posts/last-post-cursor.handler.ts @@ -1,11 +1,12 @@ -import { type ExecutionResult, graphql as executeGraphql } from 'graphql'; -import { HttpResponse, graphql } from 'msw'; +import { type ExecutionResult, graphql } from 'graphql'; +import { HttpResponse } from 'msw'; import type { LastPostCursorResponse } from '../../../../src/services/graphql'; import { wpPostsFixture } from '../../../fixtures'; import { getConnection } from '../../../utils/graphql'; +import { wordpressAPI } from '../../instances'; import { schema } from '../../schema'; -export const lastPostCursorHandler = graphql.query< +export const lastPostCursorHandler = wordpressAPI.query< LastPostCursorResponse, Record<'first', number> >('LastPostCursor', async ({ query, variables }) => { @@ -14,7 +15,7 @@ export const lastPostCursorHandler = graphql.query< if (isError) return HttpResponse.json({ data: { posts: null } }); - const { data, errors } = (await executeGraphql({ + const { data, errors } = (await graphql({ schema, source: query, variableValues: variables, |
