@revojs/graphql 0.1.28

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.
@@ -0,0 +1,7 @@
1
+ import { Mergeable, Module } from "revojs";
2
+ import { Types } from "@graphql-codegen/plugin-helpers";
3
+
4
+ //#region src/index.d.ts
5
+ declare function graphql(config: Mergeable<Types.Config>): Module;
6
+ //#endregion
7
+ export { graphql };
package/dist/index.js ADDED
@@ -0,0 +1,29 @@
1
+ import { generate } from "@graphql-codegen/cli";
2
+ import { DocumentMode } from "@graphql-codegen/visitor-plugin-common";
3
+ import { mergeObjects } from "revojs";
4
+ import { addTemplate } from "revojs/kit";
5
+
6
+ //#region src/index.ts
7
+ function graphql(config) {
8
+ return { async setup(app) {
9
+ const output = await generate(mergeObjects({
10
+ documents: "./graphql/**/*.{gql,graphql}",
11
+ generates: { "./graphql/index.ts": {
12
+ plugins: [
13
+ "typescript",
14
+ "typescript-operations",
15
+ "typed-document-node"
16
+ ],
17
+ config: {
18
+ maybeValue: "T | undefined",
19
+ useTypeImports: true,
20
+ documentMode: DocumentMode.string
21
+ }
22
+ } }
23
+ }, config), false);
24
+ addTemplate(app, "graphql.ts", () => output.at(0)?.content ?? "");
25
+ } };
26
+ }
27
+
28
+ //#endregion
29
+ export { graphql };
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@revojs/graphql",
3
+ "version": "0.1.28",
4
+ "type": "module",
5
+ "repository": "coverbase/revojs",
6
+ "license": "MIT",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js"
11
+ }
12
+ },
13
+ "types": "./dist/index.d.ts",
14
+ "module": "./dist/index.js",
15
+ "main": "./dist/index.js",
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsdown",
21
+ "watch": "tsdown -w"
22
+ },
23
+ "dependencies": {
24
+ "@graphql-codegen/cli": "^6.1.1",
25
+ "@graphql-codegen/typescript": "^5.0.7",
26
+ "@graphql-codegen/typescript-operations": "^5.0.7",
27
+ "@graphql-codegen/visitor-plugin-common": "^6.2.2",
28
+ "graphql": "^16.12.0",
29
+ "revojs": "*"
30
+ },
31
+ "devDependencies": {
32
+ "@revojs/tsconfig": "*",
33
+ "tsdown": "^0.15.1"
34
+ }
35
+ }