@wundergraph/protographic 0.17.1 → 0.17.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.
Files changed (2) hide show
  1. package/README.md +9 -8
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -54,7 +54,7 @@ const protoOutput = compileGraphQLToProto(
54
54
  packageName: 'user.v1', // Package name
55
55
  goPackage: 'cosmo/pkg/my_package', // Go package name
56
56
  lockFilePath: './proto.lock.json', // Optional: Path to proto.lock.json for deterministic field ordering
57
- }
57
+ },
58
58
  );
59
59
  ```
60
60
 
@@ -68,21 +68,21 @@ import { compileGraphQLToProto } from '@wundergraph/protographic';
68
68
  // First generation with a new lock file
69
69
  const result1 = compileGraphQLToProto(initialSchema, {
70
70
  serviceName: 'MyService',
71
- lockFilePath: './proto.lock.json' // Creates lock file if it doesn't exist
71
+ lockFilePath: './proto.lock.json', // Creates lock file if it doesn't exist
72
72
  });
73
73
 
74
74
  // Later generation with schema changes but preserving field order
75
75
  const result2 = compileGraphQLToProto(updatedSchema, {
76
76
  serviceName: 'MyService',
77
- lockFilePath: './proto.lock.json' // Uses existing lock file
77
+ lockFilePath: './proto.lock.json', // Uses existing lock file
78
78
  });
79
79
  ```
80
80
 
81
81
  When providing a `lockFilePath`, the function returns an object with both the proto definition and the lock data:
82
82
 
83
83
  ```typescript
84
- const { proto, lockData } = compileGraphQLToProto(schema, {
85
- lockFilePath: './proto.lock.json'
84
+ const { proto, lockData } = compileGraphQLToProto(schema, {
85
+ lockFilePath: './proto.lock.json',
86
86
  });
87
87
  ```
88
88
 
@@ -93,7 +93,7 @@ import { compileGraphQLToProto, ProtoLock } from '@wundergraph/protographic';
93
93
 
94
94
  // First generation - creates initial lock data
95
95
  const result1 = compileGraphQLToProto(initialSchema, {
96
- serviceName: 'MyService'
96
+ serviceName: 'MyService',
97
97
  });
98
98
  const proto1 = result1.proto;
99
99
  const lockData = result1.lockData;
@@ -104,11 +104,12 @@ const lockData = result1.lockData;
104
104
  // Later generation with the saved lock data
105
105
  const result2 = compileGraphQLToProto(updatedSchema, {
106
106
  serviceName: 'MyService',
107
- lockData: lockData // Use previously generated lock data
107
+ lockData: lockData, // Use previously generated lock data
108
108
  });
109
109
  ```
110
110
 
111
111
  The lock data records the order of:
112
+
112
113
  - Service methods
113
114
  - Message fields
114
115
  - Enum values
@@ -141,7 +142,7 @@ query GetUser($userId: ID!) {
141
142
  const result = compileOperationsToProto(operation, schema, {
142
143
  serviceName: 'UserService',
143
144
  packageName: 'user.v1',
144
- prefixOperationType: true
145
+ prefixOperationType: true,
145
146
  });
146
147
  ```
147
148
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wundergraph/protographic",
3
- "version": "0.17.1",
3
+ "version": "0.17.3",
4
4
  "module": "src/index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -27,7 +27,7 @@
27
27
  "bench": "vitest bench --run",
28
28
  "lint": "eslint --cache --ext .ts,.mjs,.cjs . && prettier -c src",
29
29
  "lint:fix": "eslint --cache --fix --ext .ts,.mjs,.cjs . && pnpm format",
30
- "format": "prettier -w -c ."
30
+ "format": "prettier -w ."
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/lodash-es": "4.17.12",
@@ -42,10 +42,10 @@
42
42
  "dependencies": {
43
43
  "@bufbuild/protobuf": "^1.8.0",
44
44
  "@wundergraph/composition": "0.53.0",
45
- "@wundergraph/cosmo-connect": "0.133.0",
45
+ "@wundergraph/cosmo-connect": "0.135.0",
46
46
  "graphql": "^16.9.0",
47
47
  "lodash-es": "4.17.21",
48
48
  "protobufjs": "^7.5.0"
49
49
  },
50
- "gitHead": "8307678e9c646caf26b3cbed3af9f2242e64e9ff"
50
+ "gitHead": "0f18fcdeac22d62e50be3022f688f891a1b696f9"
51
51
  }