Skip to content

Commit

Permalink
fix: imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt committed Mar 25, 2024
1 parent 5fe1cea commit 0d1e1a6
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/ResultSet/ResultSet.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/ban-types */

import { expectTypeOf, test } from 'vitest'
import type * as Schema from '../../tests/builder/_/schema.js'
import type * as Schema from '../../tests/ts/_/schema.js'
import type { SelectionSet } from '../SelectionSet/__.js'
import type { ResultSet } from './__.js'

Expand Down
2 changes: 1 addition & 1 deletion src/SelectionSet/SelectionSet.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assertType, expectTypeOf, test } from 'vitest'
import type * as Schema from '../../tests/builder/_/schema.js'
import type * as Schema from '../../tests/ts/_/schema.js'
import type { SelectionSet } from './__.js'

type Q = SelectionSet.Query<Schema.$.Index>
Expand Down
2 changes: 1 addition & 1 deletion src/SelectionSet/toGraphQLDocumentString.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { parse, print } from 'graphql'
import { describe, expect, test } from 'vitest'
import type * as Schema from '../../tests/builder/_/schema.js'
import type * as Schema from '../../tests/ts/_/schema.js'
import type { SelectionSet } from './__.js'
import { toGraphQLDocumentString } from './toGraphQLDocumentString.js'

Expand Down
4 changes: 2 additions & 2 deletions src/client.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, test } from 'vitest'
import type { $ } from '../tests/builder/_/schema.js'
import { setupMockServer } from '../tests/legacy/__helpers.js'
import { setupMockServer } from '../tests/raw/__helpers.js'
import type { $ } from '../tests/ts/_/schema.js'
import { create } from './client.js'

const ctx = setupMockServer()
Expand Down
22 changes: 11 additions & 11 deletions src/entrypoints/main.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { ClientError } from '../legacy/classes/ClientError.js'
import { ClientError } from '../raw/classes/ClientError.js'
import {
type BatchRequestDocument,
type BatchRequestsExtendedOptions,
type BatchRequestsOptions,
} from '../legacy/functions/batchRequests.js'
import { RequestExtendedOptions } from '../legacy/functions/request.js'
import { request } from '../legacy/functions/request.js'
import type { GraphQLResponse, RequestMiddleware, ResponseMiddleware } from '../legacy/helpers/types.js'
import { RawRequestOptions, RequestDocument, RequestOptions, Variables } from '../legacy/helpers/types.js'
export { GraphQLClient } from '../legacy/classes/GraphQLClient.js'
export { batchRequests } from '../legacy/functions/batchRequests.js'
export { gql } from '../legacy/functions/gql.js'
export { rawRequest } from '../legacy/functions/rawRequest.js'
export { analyzeDocument } from '../legacy/helpers/analyzeDocument.js'
} from '../raw/functions/batchRequests.js'
import { RequestExtendedOptions } from '../raw/functions/request.js'
import { request } from '../raw/functions/request.js'
import type { GraphQLResponse, RequestMiddleware, ResponseMiddleware } from '../raw/helpers/types.js'
import { RawRequestOptions, RequestDocument, RequestOptions, Variables } from '../raw/helpers/types.js'
export { GraphQLClient } from '../raw/classes/GraphQLClient.js'
export { batchRequests } from '../raw/functions/batchRequests.js'
export { gql } from '../raw/functions/gql.js'
export { rawRequest } from '../raw/functions/rawRequest.js'
export { analyzeDocument } from '../raw/helpers/analyzeDocument.js'
export {
BatchRequestDocument,
BatchRequestsExtendedOptions,
Expand Down
2 changes: 1 addition & 1 deletion tests/raw/httpMethod.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, test, vitest } from 'vitest'
import { gql, GraphQLClient } from '../../src/entrypoints/main.js'
import type { RequestConfig } from '../../src/legacy/helpers/types.js'
import { CONTENT_TYPE_HEADER, statusCodes } from '../../src/lib/http.js'
import type { RequestConfig } from '../../src/raw/helpers/types.js'

test(`mutation forces a POST method even if input wants GET for query`, async () => {
const fetch = vitest.fn().mockImplementation((_: string, requestConfig: RequestConfig) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/raw/json-serializer.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { beforeEach, describe, expect, test, vitest } from 'vitest'
import { GraphQLClient } from '../../src/entrypoints/main.js'
import type { Fetch, Variables } from '../../src/legacy/helpers/types.js'
import { CONTENT_TYPE_HEADER, statusCodes } from '../../src/lib/http.js'
import type { Fetch, Variables } from '../../src/raw/helpers/types.js'
import { setupMockServer } from './__helpers.js'

const ctx = setupMockServer()
Expand Down
6 changes: 3 additions & 3 deletions tests/ts/generate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { generateFile } from '../../src/generator/generator.js'
test(`generates types from GraphQL SDL file`, async () => {
await generateFile({
schemaModulePath: `../../../src/Schema/__.js`,
schemaPath: `./tests/builder/_/schema.graphql`,
typeScriptPath: `./tests/builder/_/schema.ts`,
schemaPath: `./tests/ts/_/schema.graphql`,
typeScriptPath: `./tests/ts/_/schema.ts`,
})
expect(
await readFile(`./tests/builder/_/schema.ts`, `utf8`),
await readFile(`./tests/ts/_/schema.ts`, `utf8`),
).toMatchSnapshot()
})

0 comments on commit 0d1e1a6

Please sign in to comment.