Skip to content

Commit

Permalink
fix: log error when no endpoint is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
gbicou committed Jul 7, 2023
1 parent 46bb691 commit 925cced
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -71,6 +71,10 @@ export default defineNuxtModule<ModuleOptions>({
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,
Expand Down

2 comments on commit 925cced

@vercel
Copy link

@vercel vercel bot commented on 925cced Jul 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nuxt-urql-docs – ./docs

nuxt-urql-docs-git-main-bicou.vercel.app
nuxt-urql-docs-bicou.vercel.app
nuxt-urql-docs.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 925cced Jul 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nuxt-urql-playground – ./playground

nuxt-urql-playground.vercel.app
nuxt-urql-playground-git-main-bicou.vercel.app
nuxt-urql-playground-bicou.vercel.app

Please sign in to comment.