@revojs/graphql 0.1.34 → 0.1.35

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.
Files changed (2) hide show
  1. package/dist/index.mjs +28 -14
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -5,22 +5,36 @@ import { addTypes, addVirtual } from "revojs/kit";
5
5
  //#region src/index.ts
6
6
  function graphql(config) {
7
7
  return { async setup(app) {
8
- const content = (await generate(mergeObjects({
8
+ const output = await generate(mergeObjects({
9
9
  documents: "./graphql/**/*.{gql,graphql}",
10
- generates: { "./graphql/index.ts": {
11
- plugins: [
12
- "typescript",
13
- "typescript-operations",
14
- "typed-document-node"
15
- ],
16
- config: {
17
- maybeValue: "T | undefined",
18
- useTypeImports: true
10
+ generates: {
11
+ "./graphql/index.d.ts": {
12
+ plugins: [
13
+ "typescript",
14
+ "typescript-operations",
15
+ "typed-document-node"
16
+ ],
17
+ config: {
18
+ maybeValue: "T | undefined",
19
+ useTypeImports: true
20
+ }
21
+ },
22
+ "./graphql/index.ts": {
23
+ plugins: [
24
+ "typescript",
25
+ "typescript-operations",
26
+ "typed-document-node"
27
+ ],
28
+ config: {
29
+ maybeValue: "T | undefined",
30
+ useTypeImports: true,
31
+ documentMode: "string"
32
+ }
19
33
  }
20
- } }
21
- }, config), false)).at(0)?.content ?? "";
22
- addVirtual(app, "graphql", () => content);
23
- addTypes(app, "graphql", () => `declare module "#virtual/graphql" { ${content} }`);
34
+ }
35
+ }, config), false);
36
+ addTypes(app, "graphql", () => `declare module "#virtual/graphql" { ${output.at(0)?.content ?? ""} }`);
37
+ addVirtual(app, "graphql", () => output.at(1)?.content ?? "");
24
38
  } };
25
39
  }
26
40
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revojs/graphql",
3
- "version": "0.1.34",
3
+ "version": "0.1.35",
4
4
  "type": "module",
5
5
  "repository": "coverbase/revojs",
6
6
  "license": "MIT",