diff --git a/packages/nuxt/src/runtime/composables/schema.ts b/packages/nuxt/src/runtime/composables/schema.ts index d54121b..72068a1 100644 --- a/packages/nuxt/src/runtime/composables/schema.ts +++ b/packages/nuxt/src/runtime/composables/schema.ts @@ -1,22 +1,22 @@ import { useSchema } from '@gqfn/core' import type { DollarEnum, Endpoints, ExactEndpoints, LoadGQFn, LoadGQP } from '../internal/utils/schema' import type { UseGQFnSchema, UseGQFnSchemaWithWarning } from '../internal/types/composables/schema' -import type { ModuleRuntimeConfig } from '../../module' -import { useRuntimeConfig } from '#imports' +// import type { ModuleRuntimeConfig } from '../../module' +// import { useRuntimeConfig } from '#imports' export function useGQFnSchema(): UseGQFnSchema export function useGQFnSchema(endpoint: T): UseGQFnSchema export function useGQFnSchema(endpoint: string): UseGQFnSchemaWithWarning export function useGQFnSchema(endpoint?: T): UseGQFnSchema { - if (import.meta.dev && endpoint) { - // Check if the schema is defined in the config - (async () => { - const { clientList } = (useRuntimeConfig() as unknown as ModuleRuntimeConfig).public.gqfn - if (clientList && !clientList.includes(endpoint)) { - console.warn(`useGQFnSchema: "${endpoint}" is not typed, please add it to gqfn.clients in your nuxt config`) - } - })() - } + // if (import.meta.dev && endpoint) { + // // Check if the schema is defined in the config + // (async () => { + // const { clientList } = (useRuntimeConfig() as unknown as ModuleRuntimeConfig).public.gqfn + // if (clientList && !clientList.includes(endpoint)) { + // console.warn(`useGQFnSchema: "${endpoint}" is not typed, please add it to gqfn.clients in your nuxt config`) + // } + // })() + // } const schema = useSchema(endpoint) as { gqfn: LoadGQFn diff --git a/packages/nuxt/src/runtime/server/utils/schema.ts b/packages/nuxt/src/runtime/server/utils/schema.ts index bb2c5fa..a7e0b41 100644 --- a/packages/nuxt/src/runtime/server/utils/schema.ts +++ b/packages/nuxt/src/runtime/server/utils/schema.ts @@ -1,8 +1,8 @@ import type { $enum } from '@gqfn/core' import { useSchema } from '@gqfn/core' import type { DollarEnum, Endpoints, ExactEndpoints, LoadGQFn, LoadGQP } from '../../internal/utils/schema' -import type { ModuleRuntimeConfig } from '../../../module' -import { useRuntimeConfig } from '#build/types/nitro-imports' +// import type { ModuleRuntimeConfig } from '../../../module' +// import { useRuntimeConfig } from '#build/types/nitro-imports' export interface ServerUseSchema< TEndpoint extends Endpoints, @@ -33,15 +33,15 @@ export function useGQFnSchema(endpoint: T): ServerUseS */ export function useGQFnSchema(endpoint: string): ServerUseSchemaWithWarning export function useGQFnSchema(endpoint?: T): ServerUseSchema { - if (import.meta.dev && endpoint) { - // Check if the schema is defined in the config - (async () => { - const { clientList } = (useRuntimeConfig() as unknown as ModuleRuntimeConfig).public.gqfn - if (clientList && !clientList.includes(endpoint)) { - console.warn(`useGQFnSchema: "${endpoint}" is not typed, please add it to gqfn.clients in your nuxt config`) - } - })() - } + // if (import.meta.dev && endpoint) { + // // Check if the schema is defined in the config + // (async () => { + // const { clientList } = (useRuntimeConfig() as unknown as ModuleRuntimeConfig).public.gqfn + // if (clientList && !clientList.includes(endpoint)) { + // console.warn(`useGQFnSchema: "${endpoint}" is not typed, please add it to gqfn.clients in your nuxt config`) + // } + // })() + // } const schema = useSchema(endpoint) as { gqfn: LoadGQFn