@lewebsimple/nuxt-graphql 0.7.1 → 0.7.3
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 +1 -1
- package/dist/module.mjs +18 -3
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
2
2
|
import { relative, resolve, parse, dirname } from 'node:path';
|
|
3
3
|
import { stitchSchemas } from '@graphql-tools/stitch';
|
|
4
|
+
import { extendSchemaWithZodDirectives } from '@lewebsimple/graphql-codegen-zod/extend-schema';
|
|
4
5
|
import { createResolver, addTemplate, addTypeTemplate, defineNuxtModule, useLogger, addServerImports, updateTemplates, addServerHandler, addPlugin, addImportsDir, addServerImportsDir } from '@nuxt/kit';
|
|
5
6
|
import { defu } from 'defu';
|
|
6
7
|
import { parse as parse$1, printSchema, lexicographicSortSchema, getIntrospectionQuery, buildClientSchema, GraphQLSchema, buildSchema } from 'graphql';
|
|
@@ -15,7 +16,7 @@ import zodPreset from '@lewebsimple/graphql-codegen-zod';
|
|
|
15
16
|
import { createRequire } from 'node:module';
|
|
16
17
|
import { resolveCacheConfig } from '../dist/runtime/app/lib/cache-config.js';
|
|
17
18
|
|
|
18
|
-
const version = "0.7.
|
|
19
|
+
const version = "0.7.3";
|
|
19
20
|
|
|
20
21
|
const buildCache = /* @__PURE__ */ new Map();
|
|
21
22
|
function getCachedLoader(baseKey, loader) {
|
|
@@ -175,7 +176,11 @@ async function generateRegistryArtifacts({
|
|
|
175
176
|
baseOutputDir: "registry.ts",
|
|
176
177
|
schema: parse$1(printSchema(schema)),
|
|
177
178
|
documents,
|
|
178
|
-
config: {
|
|
179
|
+
config: {
|
|
180
|
+
scalars: {
|
|
181
|
+
ZodValue: "unknown"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
179
184
|
pluginMap: {},
|
|
180
185
|
plugins: [],
|
|
181
186
|
presetConfig: {}
|
|
@@ -501,6 +506,7 @@ const module$1 = defineNuxtModule({
|
|
|
501
506
|
throw new Error("Failed to load GraphQL schema");
|
|
502
507
|
}
|
|
503
508
|
}
|
|
509
|
+
schema = extendSchemaWithZodDirectives(schema);
|
|
504
510
|
if (nuxt.options.dev) {
|
|
505
511
|
const sdl = getSchemaSDL(schema);
|
|
506
512
|
await writeFile(sdlPath, sdl);
|
|
@@ -551,7 +557,16 @@ const module$1 = defineNuxtModule({
|
|
|
551
557
|
const configPath = resolveRoot(options.saveConfig || "graphql.config.json");
|
|
552
558
|
const config = {
|
|
553
559
|
schema: toRelativePath(rootDir, sdlPath),
|
|
554
|
-
documents: documentGlobs.map((glob) => toRelativePath(rootDir, glob))
|
|
560
|
+
documents: documentGlobs.map((glob) => toRelativePath(rootDir, glob)),
|
|
561
|
+
extensions: {
|
|
562
|
+
codegen: {
|
|
563
|
+
config: {
|
|
564
|
+
scalars: {
|
|
565
|
+
ZodValue: "unknown"
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
}
|
|
555
570
|
};
|
|
556
571
|
await writeFile(configPath, JSON.stringify(config, null, 2));
|
|
557
572
|
}
|