@lewebsimple/nuxt-graphql 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lewebsimple/nuxt-graphql",
3
3
  "configKey": "graphql",
4
- "version": "0.3.1",
4
+ "version": "0.3.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -310,7 +310,9 @@ const module$1 = defineNuxtModule({
310
310
  name: "@lewebsimple/nuxt-graphql",
311
311
  configKey: "graphql"
312
312
  },
313
- defaults: {},
313
+ defaults: {
314
+ schemas: {}
315
+ },
314
316
  async setup(options, nuxt) {
315
317
  const { resolve } = createResolver(import.meta.url);
316
318
  const { buildDir, rootDir } = nuxt.options;
@@ -326,6 +328,9 @@ const module$1 = defineNuxtModule({
326
328
  }
327
329
  serverProxies["context"] = getGraphQLContextProxy(contextPath);
328
330
  serverProxies["remote-executor"] = getGenericServerProxy(resolve("./runtime/server/lib/remote-executor.ts"));
331
+ if (Object.keys(options.schemas || {}).length === 0) {
332
+ throw new Error("At least one GraphQL schema must be defined in the module options.");
333
+ }
329
334
  for (const [schemaName, schemaDef] of Object.entries(options.schemas)) {
330
335
  switch (schemaDef.type) {
331
336
  case "local": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lewebsimple/nuxt-graphql",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Opinionated Nuxt module for using GraphQL",
5
5
  "repository": "lewebsimple/nuxt-graphql",
6
6
  "license": "MIT",