@snowtop/ent 0.1.0-alpha94 → 0.1.0-alpha95

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snowtop/ent",
3
- "version": "0.1.0-alpha94",
3
+ "version": "0.1.0-alpha95",
4
4
  "description": "snowtop ent framework",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -12,7 +12,7 @@
12
12
  "camel-case": "^4.1.2",
13
13
  "cosmiconfig": "^7.0.1",
14
14
  "dataloader": "^2.0.0",
15
- "glob": "^7.1.6",
15
+ "glob": "^8.0.3",
16
16
  "graph-data-structure": "^1.12.0",
17
17
  "js-yaml": "^4.1.0",
18
18
  "json5": "^2.1.3",
package/schema/field.d.ts CHANGED
@@ -143,6 +143,7 @@ export interface EnumOptions extends FieldOptions {
143
143
  tsType?: string;
144
144
  graphQLType?: string;
145
145
  createEnumType?: boolean;
146
+ disableUnknownType?: boolean;
146
147
  }
147
148
  /**
148
149
  * @deprecated Use StringEnumField
package/schema/field.js CHANGED
@@ -514,6 +514,7 @@ class EnumField extends BaseField {
514
514
  enumMap: options.map,
515
515
  type: options.tsType,
516
516
  graphQLType: options.graphQLType,
517
+ disableUnknownType: options.disableUnknownType,
517
518
  };
518
519
  if (!options.foreignKey) {
519
520
  if (!options.values && !options.map) {
@@ -159,6 +159,7 @@ export interface Type {
159
159
  enumMap?: EnumMap;
160
160
  intEnumMap?: IntEnumMap;
161
161
  deprecatedIntEnumMap?: IntEnumMap;
162
+ disableUnknownType?: boolean;
162
163
  importType?: ImportType;
163
164
  subFields?: FieldMap;
164
165
  unionFields?: FieldMap;
@@ -164,7 +164,7 @@ function buildTreeFromQueryPaths(schema, fieldType, ...options) {
164
164
  let parts = [];
165
165
  let match = fragmentRegex.exec(path);
166
166
  if (match) {
167
- // fragment, keep the part of the fragment e.g. ...onUser, and then split the rest....
167
+ // fragment, keep the part of the fragment e.g. `...on User`, and then split the rest....
168
168
  parts = [match[0], ...match[2].split(".")];
169
169
  const typ = schema.getType(match[1]);
170
170
  if (!typ) {
@@ -223,7 +223,7 @@ function buildTreeFromQueryPaths(schema, fieldType, ...options) {
223
223
  }
224
224
  // only spread out if an object
225
225
  const [typ, _] = getInnerType(subField.type, true);
226
- return (0, graphql_1.isScalarType)(typ);
226
+ return (0, graphql_1.isScalarType)(typ) || (0, graphql_1.isEnumType)(typ);
227
227
  }
228
228
  if (i === parts.length - 1 && typeof option[1] === "object") {
229
229
  if (!isScalarField(part)) {