@snowtop/ent 0.1.0-alpha100 → 0.1.0-alpha102

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.
@@ -49,6 +49,7 @@ export interface CustomField extends CustomFieldImpl {
49
49
  results: Field[];
50
50
  extraImports?: any[];
51
51
  functionContents?: string;
52
+ edgeName?: string;
52
53
  }
53
54
  export interface CustomMutation extends CustomField {
54
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snowtop/ent",
3
- "version": "0.1.0-alpha100",
3
+ "version": "0.1.0-alpha102",
4
4
  "description": "snowtop ent framework",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -112,6 +112,7 @@ function processTopLevel(l, l2, gqlCapture) {
112
112
  nodeName: custom.class,
113
113
  functionName: custom.functionName || custom.name,
114
114
  gqlName: custom.graphQLName || custom.name,
115
+ edgeName: custom.edgeName,
115
116
  fieldType: custom.fieldType,
116
117
  args: transformArgs(custom, gqlCapture),
117
118
  results: transformResultType(custom),
@@ -121,6 +122,11 @@ function processTopLevel(l, l2, gqlCapture) {
121
122
  });
122
123
  }
123
124
  }
125
+ function processCustomTypes(m, gqlCapture) {
126
+ for (const k in m) {
127
+ (0, graphql_1.addCustomType)(m[k], gqlCapture);
128
+ }
129
+ }
124
130
  function processCustomFields(fields, gqlCapture, nodeName) {
125
131
  const m = gqlCapture.getCustomFields();
126
132
  let results = [];
@@ -166,6 +172,9 @@ async function captureDynamic(filePath, gqlCapture) {
166
172
  case "mutations":
167
173
  processTopLevel(v, gqlCapture.getCustomMutations(), gqlCapture);
168
174
  break;
175
+ case "customTypes":
176
+ processCustomTypes(v, gqlCapture);
177
+ break;
169
178
  default:
170
179
  reject(new Error(`key ${k} is unsupported in dynamic custom graphql. only queries and mutations are supported`));
171
180
  }
@@ -197,9 +206,7 @@ async function captureCustom(filePath, filesCsv, jsonPath, gqlCapture) {
197
206
  processTopLevel(json.mutations, gqlCapture.getCustomMutations(), gqlCapture);
198
207
  }
199
208
  if (json.customTypes) {
200
- for (const k in json.customTypes) {
201
- (0, graphql_1.addCustomType)(json.customTypes[k], gqlCapture);
202
- }
209
+ processCustomTypes(json.customTypes, gqlCapture);
203
210
  }
204
211
  return;
205
212
  }