Skip to content

Commit fd7c8bc

Browse files
committed
chore(nuxt): disable schema check
1 parent fb02d54 commit fd7c8bc

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

packages/nuxt/src/runtime/composables/schema.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import { useSchema } from '@gqfn/core'
22
import type { DollarEnum, Endpoints, ExactEndpoints, LoadGQFn, LoadGQP } from '../internal/utils/schema'
33
import type { UseGQFnSchema, UseGQFnSchemaWithWarning } from '../internal/types/composables/schema'
4-
import type { ModuleRuntimeConfig } from '../../module'
5-
import { useRuntimeConfig } from '#imports'
4+
// import type { ModuleRuntimeConfig } from '../../module'
5+
// import { useRuntimeConfig } from '#imports'
66

77
export function useGQFnSchema(): UseGQFnSchema<string>
88
export function useGQFnSchema<T extends ExactEndpoints>(endpoint: T): UseGQFnSchema<T>
99
export function useGQFnSchema(endpoint: string): UseGQFnSchemaWithWarning
1010
export function useGQFnSchema<T extends Endpoints>(endpoint?: T): UseGQFnSchema<T> {
11-
if (import.meta.dev && endpoint) {
12-
// Check if the schema is defined in the config
13-
(async () => {
14-
const { clientList } = (useRuntimeConfig() as unknown as ModuleRuntimeConfig).public.gqfn
15-
if (clientList && !clientList.includes(endpoint)) {
16-
console.warn(`useGQFnSchema: "${endpoint}" is not typed, please add it to gqfn.clients in your nuxt config`)
17-
}
18-
})()
19-
}
11+
// if (import.meta.dev && endpoint) {
12+
// // Check if the schema is defined in the config
13+
// (async () => {
14+
// const { clientList } = (useRuntimeConfig() as unknown as ModuleRuntimeConfig).public.gqfn
15+
// if (clientList && !clientList.includes(endpoint)) {
16+
// console.warn(`useGQFnSchema: "${endpoint}" is not typed, please add it to gqfn.clients in your nuxt config`)
17+
// }
18+
// })()
19+
// }
2020

2121
const schema = useSchema(endpoint) as {
2222
gqfn: LoadGQFn<T>

packages/nuxt/src/runtime/server/utils/schema.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { $enum } from '@gqfn/core'
22
import { useSchema } from '@gqfn/core'
33
import type { DollarEnum, Endpoints, ExactEndpoints, LoadGQFn, LoadGQP } from '../../internal/utils/schema'
4-
import type { ModuleRuntimeConfig } from '../../../module'
5-
import { useRuntimeConfig } from '#build/types/nitro-imports'
4+
// import type { ModuleRuntimeConfig } from '../../../module'
5+
// import { useRuntimeConfig } from '#build/types/nitro-imports'
66

77
export interface ServerUseSchema<
88
TEndpoint extends Endpoints,
@@ -33,15 +33,15 @@ export function useGQFnSchema<T extends ExactEndpoints>(endpoint: T): ServerUseS
3333
*/
3434
export function useGQFnSchema(endpoint: string): ServerUseSchemaWithWarning
3535
export function useGQFnSchema<T extends Endpoints>(endpoint?: T): ServerUseSchema<T> {
36-
if (import.meta.dev && endpoint) {
37-
// Check if the schema is defined in the config
38-
(async () => {
39-
const { clientList } = (useRuntimeConfig() as unknown as ModuleRuntimeConfig).public.gqfn
40-
if (clientList && !clientList.includes(endpoint)) {
41-
console.warn(`useGQFnSchema: "${endpoint}" is not typed, please add it to gqfn.clients in your nuxt config`)
42-
}
43-
})()
44-
}
36+
// if (import.meta.dev && endpoint) {
37+
// // Check if the schema is defined in the config
38+
// (async () => {
39+
// const { clientList } = (useRuntimeConfig() as unknown as ModuleRuntimeConfig).public.gqfn
40+
// if (clientList && !clientList.includes(endpoint)) {
41+
// console.warn(`useGQFnSchema: "${endpoint}" is not typed, please add it to gqfn.clients in your nuxt config`)
42+
// }
43+
// })()
44+
// }
4545

4646
const schema = useSchema(endpoint) as {
4747
gqfn: LoadGQFn<T>

0 commit comments

Comments
 (0)