|
1 | 1 | import type { $enum } from '@gqfn/core'
|
2 | 2 | import { useSchema } from '@gqfn/core'
|
3 | 3 | 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' |
6 | 6 |
|
7 | 7 | export interface ServerUseSchema<
|
8 | 8 | TEndpoint extends Endpoints,
|
@@ -33,15 +33,15 @@ export function useGQFnSchema<T extends ExactEndpoints>(endpoint: T): ServerUseS
|
33 | 33 | */
|
34 | 34 | export function useGQFnSchema(endpoint: string): ServerUseSchemaWithWarning
|
35 | 35 | 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 | + // } |
45 | 45 |
|
46 | 46 | const schema = useSchema(endpoint) as {
|
47 | 47 | gqfn: LoadGQFn<T>
|
|
0 commit comments