From 925cced0b7d4487eb0b0e265569f8e9bbe8861eb Mon Sep 17 00:00:00 2001 From: Benjamin VIELLARD Date: Fri, 7 Jul 2023 13:07:00 +0200 Subject: [PATCH] fix: log error when no endpoint is provided --- src/module.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/module.ts b/src/module.ts index 746b193..755ccf2 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1,4 +1,4 @@ -import { defineNuxtModule, addPlugin, createResolver, addImports, findPath } from "@nuxt/kit"; +import { defineNuxtModule, addPlugin, createResolver, addImports, findPath, logger } from "@nuxt/kit"; import type { ClientOptions, SSRExchangeParams } from "@urql/core"; import defu from "defu"; import { name, version } from "../package.json"; @@ -71,6 +71,10 @@ export default defineNuxtModule({ async setup(options, nuxt) { const { resolve } = createResolver(import.meta.url); + if (!options.endpoint) { + logger.error("Missing endpoint for URQL"); + } + // expose public options nuxt.options.runtimeConfig.public.urql = defu(nuxt.options.runtimeConfig.public.urql, { endpoint: options.endpoint,