@remkoj/optimizely-graph-functions 4.2.0 → 4.3.0
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/README.md +8 -3
- package/dist/patch.js +2 -2
- package/package.json +11 -10
package/README.md
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
# Optimizely GraphQL Codegen Plugin
|
|
2
2
|
GraphQL Codegen plugin and preset which generate both the GraphQL type definitions and a few convenienece methods for useage with [Optimizely Graph Client](../optimizely-graph-client/README.md).
|
|
3
3
|
|
|
4
|
+
[Release notes](https://github.com/remkoj/optimizely-dxp-clients/releases)
|
|
5
|
+
|
|
4
6
|
> [!WARNING]
|
|
5
|
-
>
|
|
7
|
+
> The GraphQL Codegen preset requires a patch to enable it to work with recursive queries. Make sure to run this command after every update to ensure you're using the latest patches: `yarn opti-graph patches:apply`. Adjust when used in a mono-repo to patch the correct package.json, for example: `yarn workspace frontend opti-graph patches:apply -p ../../`
|
|
6
8
|
|
|
7
9
|
## Install package
|
|
8
10
|
To install using Yarn, use the following command:
|
|
9
11
|
|
|
10
12
|
```bash
|
|
11
13
|
yarn add --dev @remkoj/optimizely-graph-functions
|
|
12
|
-
yarn patch-codegen
|
|
13
14
|
```
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
To add support for automatic applying of patches and apply them.
|
|
17
|
+
```bash
|
|
18
|
+
yarn add --dev @remkoj/optimizely-graph-cli
|
|
19
|
+
yarn opti-graph patches:apply
|
|
20
|
+
```
|
|
16
21
|
|
|
17
22
|
## Configure package
|
|
18
23
|
Create a codegen.ts within your application root folder (e.g. apps/frontend/codegen.ts within the example site). Within the codegen.ts create the following configuration:
|
package/dist/patch.js
CHANGED
|
@@ -8,8 +8,8 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
8
8
|
const posix_1 = __importDefault(require("node:path/posix"));
|
|
9
9
|
const node_stream_1 = require("node:stream");
|
|
10
10
|
const promises_1 = require("node:stream/promises");
|
|
11
|
-
const downloadLink = "https://github.com/remkoj/optimizely-dxp-clients/raw/refs/heads/main/dependencies/graphql-codegen-visitor-plugin-common-v5.
|
|
12
|
-
const downloadFile = "graphql-codegen-visitor-plugin-common-v5.
|
|
11
|
+
const downloadLink = "https://github.com/remkoj/optimizely-dxp-clients/raw/refs/heads/main/dependencies/graphql-codegen-visitor-plugin-common-v5.7.2-patched.tgz";
|
|
12
|
+
const downloadFile = "graphql-codegen-visitor-plugin-common-v5.7.2-patched.tgz";
|
|
13
13
|
const downloadPath = "./packages";
|
|
14
14
|
const packageJsonPath = node_path_1.default.join(process.cwd(), 'package.json');
|
|
15
15
|
if (!node_fs_1.default.existsSync(packageJsonPath)) {
|
package/package.json
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remkoj/optimizely-graph-functions",
|
|
3
|
-
"license": "Apache-2.0",
|
|
4
|
-
"version": "4.2.0",
|
|
5
3
|
"repository": "https://github.com/remkoj/optimizely-dxp-clients.git",
|
|
6
4
|
"author": "Remko Jantzen <693172+remkoj@users.noreply.github.com>",
|
|
7
5
|
"homepage": "https://github.com/remkoj/optimizely-dxp-clients",
|
|
6
|
+
"version": "4.3.0",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"type": "commonjs",
|
|
9
|
+
"description": "GraphQL Codegen preset for Optimizely Graph",
|
|
10
|
+
"main": "./dist/index.js",
|
|
8
11
|
"files": [
|
|
9
12
|
"./dist"
|
|
10
13
|
],
|
|
11
14
|
"bin": {
|
|
12
|
-
"patch
|
|
15
|
+
"opti-patch": "dist/patch.js"
|
|
13
16
|
},
|
|
14
|
-
"type": "commonjs",
|
|
15
|
-
"main": "./dist/index.js",
|
|
16
17
|
"exports": {
|
|
17
18
|
".": "./dist/index.js",
|
|
18
19
|
"./plugin": "./dist/index.js",
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
}
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
|
-
"@types/node": "^22.
|
|
45
|
+
"@types/node": "^22.13.5",
|
|
45
46
|
"graphql": "^16.10.0",
|
|
46
47
|
"graphql-request": "^6.1.0",
|
|
47
48
|
"graphql-tag": "^2.12.6",
|
|
@@ -49,11 +50,11 @@
|
|
|
49
50
|
},
|
|
50
51
|
"dependencies": {
|
|
51
52
|
"@graphql-codegen/add": "^5.0.3",
|
|
52
|
-
"@graphql-codegen/client-preset": "^4.
|
|
53
|
+
"@graphql-codegen/client-preset": "^4.6.4",
|
|
53
54
|
"@graphql-codegen/plugin-helpers": "^5.1.0",
|
|
54
|
-
"@graphql-codegen/typescript": "^4.1.
|
|
55
|
+
"@graphql-codegen/typescript": "^4.1.5",
|
|
55
56
|
"@graphql-codegen/typescript-graphql-request": "^6.2.0",
|
|
56
|
-
"@graphql-codegen/typescript-operations": "^4.
|
|
57
|
+
"@graphql-codegen/typescript-operations": "^4.5.1",
|
|
57
58
|
"tslib": "^2.8.1"
|
|
58
59
|
},
|
|
59
60
|
"scripts": {
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
"prepare": "tsc --build",
|
|
62
63
|
"recompile": "tsc --build --clean && tsc --build --force",
|
|
63
64
|
"watch": "yarn tsc --watch",
|
|
64
|
-
"
|
|
65
|
+
"opti-patch": "yarn node dist/patch.js"
|
|
65
66
|
},
|
|
66
67
|
"peerDependencies": {
|
|
67
68
|
"@graphql-typed-document-node/core": "^3",
|