diff options
Diffstat (limited to 'tests/msw/handlers/thematics')
4 files changed, 14 insertions, 10 deletions
diff --git a/tests/msw/handlers/thematics/thematic.handler.ts b/tests/msw/handlers/thematics/thematic.handler.ts index 1e7d129..ad82ea6 100644 --- a/tests/msw/handlers/thematics/thematic.handler.ts +++ b/tests/msw/handlers/thematics/thematic.handler.ts @@ -1,14 +1,15 @@ -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 { ThematicResponse } from '../../../../src/services/graphql'; import { wpThematicsFixture } from '../../../fixtures'; +import { wordpressAPI } from '../../instances'; import { schema } from '../../schema'; -export const thematicHandler = graphql.query< +export const thematicHandler = wordpressAPI.query< ThematicResponse, Record<'slug', string> >('Thematic', async ({ query, variables }) => { - const { data, errors } = (await executeGraphql({ + const { data, errors } = (await graphql({ schema, source: query, variableValues: variables, diff --git a/tests/msw/handlers/thematics/thematics-count.handler.ts b/tests/msw/handlers/thematics/thematics-count.handler.ts index 4bcdf2d..8a1f12e 100644 --- a/tests/msw/handlers/thematics/thematics-count.handler.ts +++ b/tests/msw/handlers/thematics/thematics-count.handler.ts @@ -1,12 +1,13 @@ import { type ExecutionResult, graphql as executeGraphql } from 'graphql'; -import { HttpResponse, graphql } from 'msw'; +import { HttpResponse } from 'msw'; import type { ThematicsCountResponse } from '../../../../src/services/graphql'; import type { GraphQLPostWhere } from '../../../../src/types'; import { wpThematicsFixture } from '../../../fixtures'; import { getConnection } from '../../../utils/graphql'; +import { wordpressAPI } from '../../instances'; import { schema } from '../../schema'; -export const thematicsCountHandler = graphql.query< +export const thematicsCountHandler = wordpressAPI.query< ThematicsCountResponse, GraphQLPostWhere >('ThematicsCount', async ({ query, variables }) => { diff --git a/tests/msw/handlers/thematics/thematics-list.handler.ts b/tests/msw/handlers/thematics/thematics-list.handler.ts index 7afec4c..790fa5a 100644 --- a/tests/msw/handlers/thematics/thematics-list.handler.ts +++ b/tests/msw/handlers/thematics/thematics-list.handler.ts @@ -1,14 +1,15 @@ import { type ExecutionResult, graphql as executeGraphql } from 'graphql'; -import { HttpResponse, graphql } from 'msw'; +import { HttpResponse } from 'msw'; import type { FetchThematicsListInput, ThematicsListResponse, } from '../../../../src/services/graphql'; import { wpThematicsFixture } from '../../../fixtures'; import { getConnection } from '../../../utils/graphql'; +import { wordpressAPI } from '../../instances'; import { schema } from '../../schema'; -export const thematicsListHandler = graphql.query< +export const thematicsListHandler = wordpressAPI.query< ThematicsListResponse, FetchThematicsListInput >('ThematicsList', async ({ query, variables }) => { diff --git a/tests/msw/handlers/thematics/thematics-slugs.handler.ts b/tests/msw/handlers/thematics/thematics-slugs.handler.ts index 3a71c8e..77bbeda 100644 --- a/tests/msw/handlers/thematics/thematics-slugs.handler.ts +++ b/tests/msw/handlers/thematics/thematics-slugs.handler.ts @@ -1,10 +1,11 @@ import { type ExecutionResult, graphql as executeGraphql } from 'graphql'; -import { HttpResponse, graphql } from 'msw'; +import { HttpResponse } from 'msw'; import type { ThematicsSlugsResponse } from '../../../../src/services/graphql'; import { wpThematicsFixture } from '../../../fixtures'; +import { wordpressAPI } from '../../instances'; import { schema } from '../../schema'; -export const thematicsSlugsHandler = graphql.query< +export const thematicsSlugsHandler = wordpressAPI.query< ThematicsSlugsResponse, Record<'first', number> >('ThematicsSlugs', async ({ query, variables }) => { |
