@luvio/compiler 0.97.1 → 0.98.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/dist/codegen/graphql/source-printer/graphql-type-source-printer.d.ts +4 -4
- package/dist/codegen/graphql/source-printer/graphql-type-source-printer.js +8 -8
- package/dist/codegen/graphql/source-printer/graphql-type-source-printer.js.map +1 -1
- package/dist/codegen/graphql/type/constants.d.ts +2 -0
- package/dist/codegen/graphql/type/constants.js +3 -1
- package/dist/codegen/graphql/type/constants.js.map +1 -1
- package/dist/codegen/graphql/type/index.js +5 -1
- package/dist/codegen/graphql/type/index.js.map +1 -1
- package/dist/codegen/graphql/type/ingest-field-by-type.d.ts +8 -0
- package/dist/codegen/graphql/type/ingest-field-by-type.js +79 -0
- package/dist/codegen/graphql/type/ingest-field-by-type.js.map +1 -0
- package/dist/codegen/graphql/type/ingest.d.ts +1 -5
- package/dist/codegen/graphql/type/ingest.js +26 -123
- package/dist/codegen/graphql/type/ingest.js.map +1 -1
- package/dist/codegen/graphql/type/is-mapped-field.d.ts +3 -0
- package/dist/codegen/graphql/type/is-mapped-field.js +37 -0
- package/dist/codegen/graphql/type/is-mapped-field.js.map +1 -0
- package/dist/codegen/graphql/type/select.d.ts +1 -1
- package/dist/codegen/graphql/type/select.js +4 -5
- package/dist/codegen/graphql/type/select.js.map +1 -1
- package/dist/codegen/graphql/type/type-from-field.d.ts +2 -5
- package/dist/codegen/graphql/type/type-from-field.js +4 -21
- package/dist/codegen/graphql/type/type-from-field.js.map +1 -1
- package/package.json +4 -4
|
@@ -9,11 +9,11 @@ import type { CompilerPlugin } from '../../../plugin';
|
|
|
9
9
|
export declare const GRAPHQL_OBJECT_TYPENAME = "typeName";
|
|
10
10
|
export declare type GraphQLTypeGenerationResult = Record<string, string>;
|
|
11
11
|
export declare class GraphQLTypeSourcePrinter implements GraphQLTypePrinter {
|
|
12
|
-
generate(graphQLResource: GraphQLResource, compilerBaseOutputDir: path.ParsedPath, metadata: GraphQLCodegenMetadata, modelInfo: ModelInfo, plugin
|
|
13
|
-
createGraphQLTypeImportContext(compilerBaseOutputDir: path.ParsedPath, defName: string): {
|
|
12
|
+
generate(graphQLResource: GraphQLResource, compilerBaseOutputDir: path.ParsedPath, metadata: GraphQLCodegenMetadata, modelInfo: ModelInfo, plugin?: CompilerPlugin): GraphQLTypeGenerationResult;
|
|
13
|
+
createGraphQLTypeImportContext(compilerBaseOutputDir: path.ParsedPath, defName: string, plugin?: CompilerPlugin): {
|
|
14
14
|
relPath: string;
|
|
15
15
|
importContext: ImportContext;
|
|
16
16
|
};
|
|
17
|
-
generateGraphQLInteropTypes(modelInfo: ModelInfo, compilerBaseOutputDir: path.ParsedPath,
|
|
18
|
-
addTypeModule(graphQLResource: GraphQLResource, compilerBaseOutputDir: path.ParsedPath, metadata: GraphQLCodegenMetadata, modules: GraphQLTypeGenerationResult): void;
|
|
17
|
+
generateGraphQLInteropTypes(modelInfo: ModelInfo, compilerBaseOutputDir: path.ParsedPath, graphqlResource: GraphQLResource, plugin?: CompilerPlugin): GraphQLTypeGenerationResult;
|
|
18
|
+
addTypeModule(graphQLResource: GraphQLResource, compilerBaseOutputDir: path.ParsedPath, metadata: GraphQLCodegenMetadata, modules: GraphQLTypeGenerationResult, plugin?: CompilerPlugin): void;
|
|
19
19
|
}
|
|
@@ -23,10 +23,10 @@ class GraphQLTypeSourcePrinter {
|
|
|
23
23
|
const { graphqlDSL } = graphQLResource;
|
|
24
24
|
const typeKeys = Object.keys(graphqlDSL.schema.getTypeMap());
|
|
25
25
|
const modules = {};
|
|
26
|
-
this.addTypeModule(graphQLResource, compilerBaseOutputDir, metadata, modules);
|
|
26
|
+
this.addTypeModule(graphQLResource, compilerBaseOutputDir, metadata, modules, plugin);
|
|
27
27
|
// TODO: What should happen if multiple endpoints use the same Representation? Technically this would be legal in RAML as the
|
|
28
28
|
// top level types are the same.
|
|
29
|
-
Object.assign(modules, this.generateGraphQLInteropTypes(modelInfo, compilerBaseOutputDir,
|
|
29
|
+
Object.assign(modules, this.generateGraphQLInteropTypes(modelInfo, compilerBaseOutputDir, graphQLResource, plugin));
|
|
30
30
|
typeKeys.forEach((typeKey) => {
|
|
31
31
|
const typeDefinition = graphqlDSL.schema.getType(typeKey);
|
|
32
32
|
if (typeDefinition !== undefined &&
|
|
@@ -34,7 +34,7 @@ class GraphQLTypeSourcePrinter {
|
|
|
34
34
|
typeDefinition.astNode !== undefined &&
|
|
35
35
|
typeDefinition.astNode !== null) {
|
|
36
36
|
const kind = typeDefinition.astNode.kind;
|
|
37
|
-
const { relPath, importContext } = this.createGraphQLTypeImportContext(compilerBaseOutputDir, typeDefinition.name);
|
|
37
|
+
const { relPath, importContext } = this.createGraphQLTypeImportContext(compilerBaseOutputDir, typeDefinition.name, plugin);
|
|
38
38
|
switch (kind) {
|
|
39
39
|
case graphql_parser_1.Kind.OBJECT_TYPE_DEFINITION:
|
|
40
40
|
modules[relPath] = (0, type_1.generateType)(graphqlDSL, typeDefinition.name, typeDefinition.astNode, importContext, metadata, modelInfo);
|
|
@@ -56,15 +56,15 @@ class GraphQLTypeSourcePrinter {
|
|
|
56
56
|
});
|
|
57
57
|
return modules;
|
|
58
58
|
}
|
|
59
|
-
createGraphQLTypeImportContext(compilerBaseOutputDir, defName) {
|
|
59
|
+
createGraphQLTypeImportContext(compilerBaseOutputDir, defName, plugin) {
|
|
60
60
|
const graphqlRelPath = path_1.default.join(_1.GRAPHQL_OUTPUT_DIRECTORY, GRAPHQL_TYPES_DIRECTORY, `${defName}.ts`);
|
|
61
61
|
const shapeAbsPath = path_1.default.parse(path_1.default.resolve(path_1.default.format(compilerBaseOutputDir), graphqlRelPath));
|
|
62
62
|
return {
|
|
63
63
|
relPath: graphqlRelPath,
|
|
64
|
-
importContext: (0, imports_1.createImportContext)(shapeAbsPath, compilerBaseOutputDir),
|
|
64
|
+
importContext: (0, imports_1.createImportContext)(shapeAbsPath, compilerBaseOutputDir, plugin),
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
generateGraphQLInteropTypes(modelInfo, compilerBaseOutputDir,
|
|
67
|
+
generateGraphQLInteropTypes(modelInfo, compilerBaseOutputDir, graphqlResource, plugin) {
|
|
68
68
|
const modules = {};
|
|
69
69
|
for (const shape of Object.values(modelInfo.declaredShapeDefinitions)) {
|
|
70
70
|
if ((0, utils_1.isNodeShape)(shape) && modelInfo.graphQLShapes[shape.id]) {
|
|
@@ -81,8 +81,8 @@ class GraphQLTypeSourcePrinter {
|
|
|
81
81
|
}
|
|
82
82
|
return modules;
|
|
83
83
|
}
|
|
84
|
-
addTypeModule(graphQLResource, compilerBaseOutputDir, metadata, modules) {
|
|
85
|
-
const { importContext, relPath } = this.createGraphQLTypeImportContext(compilerBaseOutputDir, 'type-util');
|
|
84
|
+
addTypeModule(graphQLResource, compilerBaseOutputDir, metadata, modules, plugin) {
|
|
85
|
+
const { importContext, relPath } = this.createGraphQLTypeImportContext(compilerBaseOutputDir, 'type-util', plugin);
|
|
86
86
|
const typeUtil = (0, generateTypeUtil_1.generateTypeUtil)(graphQLResource, metadata, importContext);
|
|
87
87
|
modules[relPath] = typeUtil;
|
|
88
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-type-source-printer.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/source-printer/graphql-type-source-printer.ts"],"names":[],"mappings":";;;;;;AAEA,oDAA6D;AAC7D,gDAAwB;AACxB,0DAA6C;AAC7C,kCAAuC;AACvC,+DAA4D;AAC5D,oCAAyD;AACzD,kCAAuD;AAIvD,uDAA0D;AAG1D,iDAAuE;AACvE,4CAAqD;AACrD,wBAA6C;AAEhC,QAAA,uBAAuB,GAAG,UAAU,CAAC;AAClD,MAAM,uBAAuB,GAAG,OAAO,CAAC;AACxC,MAAM,oBAAoB,GAAG,OAAO,CAAC;AAIrC,MAAa,wBAAwB;IACjC,QAAQ,CACJ,eAAgC,EAChC,qBAAsC,EACtC,QAAgC,EAChC,SAAoB,EACpB,
|
|
1
|
+
{"version":3,"file":"graphql-type-source-printer.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/source-printer/graphql-type-source-printer.ts"],"names":[],"mappings":";;;;;;AAEA,oDAA6D;AAC7D,gDAAwB;AACxB,0DAA6C;AAC7C,kCAAuC;AACvC,+DAA4D;AAC5D,oCAAyD;AACzD,kCAAuD;AAIvD,uDAA0D;AAG1D,iDAAuE;AACvE,4CAAqD;AACrD,wBAA6C;AAEhC,QAAA,uBAAuB,GAAG,UAAU,CAAC;AAClD,MAAM,uBAAuB,GAAG,OAAO,CAAC;AACxC,MAAM,oBAAoB,GAAG,OAAO,CAAC;AAIrC,MAAa,wBAAwB;IACjC,QAAQ,CACJ,eAAgC,EAChC,qBAAsC,EACtC,QAAgC,EAChC,SAAoB,EACpB,MAAuB;QAEvB,MAAM,EAAE,UAAU,EAAE,GAAG,eAAe,CAAC;QACvC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAgC,EAAE,CAAC;QAEhD,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,qBAAqB,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAEtF,6HAA6H;QAC7H,gCAAgC;QAChC,MAAM,CAAC,MAAM,CACT,OAAO,EACP,IAAI,CAAC,2BAA2B,CAC5B,SAAS,EACT,qBAAqB,EACrB,eAAe,EACf,MAAM,CACT,CACJ,CAAC;QAEF,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACzB,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YAC1D,IACI,cAAc,KAAK,SAAS;gBAC5B,cAAc,KAAK,IAAI;gBACvB,cAAc,CAAC,OAAO,KAAK,SAAS;gBACpC,cAAc,CAAC,OAAO,KAAK,IAAI,EACjC;gBACE,M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GAAG,IAAI,CAAC,8BAA8B,CAClE,qBAAqB,EACrB,WAAW,EACX,MAAM,CACT,CAAC;QACF,MAAM,QAAQ,GAAW,IAAA,mCAAgB,EAAC,eAAe,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;QACpF,OAAO,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC;IAChC,CAAC;CACJ;AAxJD,4DAwJC"}
|
|
@@ -25,3 +25,5 @@ export declare const GET_QUERY_TRANSFORM_HELPER_FOR_TYPE_IDENTIFIER = "getQueryT
|
|
|
25
25
|
export declare const GET_MINIMUM_FIELDS_IDENTIFIER = "getMinimumFields";
|
|
26
26
|
export declare const QUERY_TRANSFORM_HELPER_IDENTIFIER = "QueryTransformHelper";
|
|
27
27
|
export declare const GET_FIELD_TYPE_IDENTIFIER = "getFieldType";
|
|
28
|
+
export declare const INGEST_FIELD_BY_TYPE_IDENTIFIER = "ingestFieldByType";
|
|
29
|
+
export declare const IS_MAPPED_FIELD_IDENTIFIER = "isMappedField";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_FIELD_TYPE_IDENTIFIER = exports.QUERY_TRANSFORM_HELPER_IDENTIFIER = exports.GET_MINIMUM_FIELDS_IDENTIFIER = exports.GET_QUERY_TRANSFORM_HELPER_FOR_TYPE_IDENTIFIER = exports.GET_QUERY_TRANSFORM_HELPER_FOR_FIELD_IDENTIFIER = exports.APPLY_MINIMUM_FIELDS_TO_QUERY_IDENTIFIER = exports.SINK_IDENTIFIER = exports.REQUESTED_FIELD_NAME_IDENTIFIER = exports.REQUESTED_FIELD_IDENTIFIER = exports.FIELD_DATA_KEY_IDENTIFIER = exports.FIELD_DATA_IDENTIFIER = exports.FIELD_KEY_IDENTIFIER = exports.GET_SERIALIZED_KEY_FOR_FIELD_IDENTIFIER = exports.GET_REQUESTED_FIELDS_FOR_TYPE_IDENTIFIER = exports.GET_REQUESTED_FIELD_IDENTIFIER = exports.SERIALIZE_FIELD_ARGUMENTS_IDENTIFIER = exports.KEY_BUILDER_IDENTIFIER = exports.TYPE_CACHE_KEYS_IDENTIFIER = exports.TYPE_CONVERT_IDENTIFIER = exports.TYPE_INGEST_IDENTIFIER = exports.TYPE_UTIL_IDENTIFIER = exports.CREATE_LINK_IDENTIFIER = exports.TIMESTAMP_IDENTIFIER = exports.GRAPHQL_STATE_INTERFACE_IDENTIFIER = exports.GRAPHQL_INGEST_STATE_INTERFACE_IDENTIFIER = exports.GRAPHQL_FRAGMENT_MAP_IDENTIFIER = exports.GRAPHQL_VARIABLES_IDENTIFIER = void 0;
|
|
3
|
+
exports.IS_MAPPED_FIELD_IDENTIFIER = exports.INGEST_FIELD_BY_TYPE_IDENTIFIER = exports.GET_FIELD_TYPE_IDENTIFIER = exports.QUERY_TRANSFORM_HELPER_IDENTIFIER = exports.GET_MINIMUM_FIELDS_IDENTIFIER = exports.GET_QUERY_TRANSFORM_HELPER_FOR_TYPE_IDENTIFIER = exports.GET_QUERY_TRANSFORM_HELPER_FOR_FIELD_IDENTIFIER = exports.APPLY_MINIMUM_FIELDS_TO_QUERY_IDENTIFIER = exports.SINK_IDENTIFIER = exports.REQUESTED_FIELD_NAME_IDENTIFIER = exports.REQUESTED_FIELD_IDENTIFIER = exports.FIELD_DATA_KEY_IDENTIFIER = exports.FIELD_DATA_IDENTIFIER = exports.FIELD_KEY_IDENTIFIER = exports.GET_SERIALIZED_KEY_FOR_FIELD_IDENTIFIER = exports.GET_REQUESTED_FIELDS_FOR_TYPE_IDENTIFIER = exports.GET_REQUESTED_FIELD_IDENTIFIER = exports.SERIALIZE_FIELD_ARGUMENTS_IDENTIFIER = exports.KEY_BUILDER_IDENTIFIER = exports.TYPE_CACHE_KEYS_IDENTIFIER = exports.TYPE_CONVERT_IDENTIFIER = exports.TYPE_INGEST_IDENTIFIER = exports.TYPE_UTIL_IDENTIFIER = exports.CREATE_LINK_IDENTIFIER = exports.TIMESTAMP_IDENTIFIER = exports.GRAPHQL_STATE_INTERFACE_IDENTIFIER = exports.GRAPHQL_INGEST_STATE_INTERFACE_IDENTIFIER = exports.GRAPHQL_FRAGMENT_MAP_IDENTIFIER = exports.GRAPHQL_VARIABLES_IDENTIFIER = void 0;
|
|
4
4
|
exports.GRAPHQL_VARIABLES_IDENTIFIER = 'GraphQLVariables';
|
|
5
5
|
exports.GRAPHQL_FRAGMENT_MAP_IDENTIFIER = 'GraphQLFragmentMap';
|
|
6
6
|
exports.GRAPHQL_INGEST_STATE_INTERFACE_IDENTIFIER = 'GraphQLIngestState';
|
|
@@ -28,4 +28,6 @@ exports.GET_QUERY_TRANSFORM_HELPER_FOR_TYPE_IDENTIFIER = 'getQueryTransformHelpe
|
|
|
28
28
|
exports.GET_MINIMUM_FIELDS_IDENTIFIER = 'getMinimumFields';
|
|
29
29
|
exports.QUERY_TRANSFORM_HELPER_IDENTIFIER = 'QueryTransformHelper';
|
|
30
30
|
exports.GET_FIELD_TYPE_IDENTIFIER = 'getFieldType';
|
|
31
|
+
exports.INGEST_FIELD_BY_TYPE_IDENTIFIER = 'ingestFieldByType';
|
|
32
|
+
exports.IS_MAPPED_FIELD_IDENTIFIER = 'isMappedField';
|
|
31
33
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/type/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,4BAA4B,GAAG,kBAAkB,CAAC;AAClD,QAAA,+BAA+B,GAAG,oBAAoB,CAAC;AACvD,QAAA,yCAAyC,GAAG,oBAAoB,CAAC;AACjE,QAAA,kCAAkC,GAAG,cAAc,CAAC;AACpD,QAAA,oBAAoB,GAAG,WAAW,CAAC;AACnC,QAAA,sBAAsB,GAAG,YAAY,CAAC;AACtC,QAAA,oBAAoB,GAAG,WAAW,CAAC;AACnC,QAAA,sBAAsB,GAAG,QAAQ,CAAC;AAClC,QAA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AAkB,CAAC;AAChD,QAAA,sBAAsB,GAAG,YAAY,CAAC;AACtC,QAAA,oCAAoC,GAAG,yBAAyB,CAAC;AACjE,QAAA,8BAA8B,GAAG,mBAAmB,CAAC;AACrD,QAAA,wCAAwC,GAAG,2BAA2B,CAAC;AACvE,QAAA,uCAAuC,GAAG,0BAA0B,CAAC;AACrE,QAAA,oBAAoB,GAAG,UAAU,CAAC;AAClC,QAAA,qBAAqB,GAAG,WAAW,CAAC;AACpC,QAAA,yBAAyB,GAAG,cAAc,CAAC;AAC3C,QAAA,0BAA0B,GAAG,gBAAgB,CAAC;AAC9C,QAAA,+BAA+B,GAAG,oBAAoB,CAAC;AACvD,QAAA,eAAe,GAAG,MAAM,CAAC;AACzB,QAAA,wCAAwC,GAAG,2BAA2B,CAAC;AACvE,QAAA,+CAA+C,GAAG,iCAAiC,CAAC;AACpF,QAAA,8CAA8C,GAAG,gCAAgC,CAAC;AAClF,QAAA,6BAA6B,GAAG,kBAAkB,CAAC;AACnD,QAAA,iCAAiC,GAAG,sBAAsB,CAAC;AAC3D,QAAA,yBAAyB,GAAG,cAAc,CAAC;AAC3C,QAAA,+BAA+B,GAAG,mBAAmB,CAAC;AACtD,QAAA,0BAA0B,GAAG,eAAe,CAAC"}
|
|
@@ -15,6 +15,8 @@ const select_1 = require("./select");
|
|
|
15
15
|
const query_transformer_1 = require("./query-transformer");
|
|
16
16
|
const type_cache_keys_1 = require("./type-cache-keys");
|
|
17
17
|
const type_from_field_1 = require("./type-from-field");
|
|
18
|
+
const ingest_field_by_type_1 = require("./ingest-field-by-type");
|
|
19
|
+
const is_mapped_field_1 = require("./is-mapped-field");
|
|
18
20
|
function generateType(graphqlDsl, graphqlTypeName, def, importContext, metadata, modelInfo) {
|
|
19
21
|
return (0, imports_1.resolveImports)((0, deindent_1.default) `
|
|
20
22
|
export const name = '${graphqlTypeName}';
|
|
@@ -26,7 +28,9 @@ function generateType(graphqlDsl, graphqlTypeName, def, importContext, metadata,
|
|
|
26
28
|
${(0, select_1.generateSelect)(graphqlDsl, graphqlTypeName, def, importContext, metadata)}
|
|
27
29
|
${(0, query_transformer_1.generate)(graphqlDsl, graphqlTypeName, def, importContext, metadata)}
|
|
28
30
|
${(0, type_cache_keys_1.generateGetTypeCacheKeys)(graphqlDsl, graphqlTypeName, def, importContext, metadata)}
|
|
29
|
-
${(0, type_from_field_1.generateGetFieldType)(graphqlDsl, def
|
|
31
|
+
${(0, type_from_field_1.generateGetFieldType)(graphqlDsl, def)}
|
|
32
|
+
${(0, ingest_field_by_type_1.generateIngestFieldDataByType)(graphqlDsl, graphqlTypeName, def, importContext, metadata)}
|
|
33
|
+
${(0, is_mapped_field_1.generateIsMappedField)(graphqlDsl, graphqlTypeName, def)}
|
|
30
34
|
`);
|
|
31
35
|
}
|
|
32
36
|
exports.generateType = generateType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/type/index.ts"],"names":[],"mappings":";;;;;;AAAA,uEAA+C;AAC/C,+BAAoC;AACpC,2CAAiD;AACjD,qCAA0C;AAC1C,+BAAoC;AACpC,mCAAwC;AACxC,oDAAwD;AAKxD,qCAA0C;AAC1C,2DAA2E;AAE3E,uDAA6D;AAC7D,uDAAyD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/type/index.ts"],"names":[],"mappings":";;;;;;AAAA,uEAA+C;AAC/C,+BAAoC;AACpC,2CAAiD;AACjD,qCAA0C;AAC1C,+BAAoC;AACpC,mCAAwC;AACxC,oDAAwD;AAKxD,qCAA0C;AAC1C,2DAA2E;AAE3E,uDAA6D;AAC7D,uDAAyD;AACzD,iEAAuE;AACvE,uDAA0D;AAE1D,SAAgB,YAAY,CACxB,UAA2B,EAC3B,eAAuB,EACvB,GAA6B,EAC7B,aAA4B,EAC5B,QAAgC,EAChC,SAAoB;IAEpB,OAAO,IAAA,wBAAc,EAAC,IAAA,kBAAQ,EAAA;+BACH,eAAe;UACpC,IAAA,iBAAW,EAAC,UAAU,EAAE,eAAe,CAAC;UACxC,IAAA,8BAAkB,EAAC,UAAU,EAAE,eAAe,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,CAAC;UAC7E,IAAA,iBAAW,EAAC,GAAG,EAAE,aAAa,EAAE,UAAU,CAAC,UAAU,CAAC;UACtD,IAAA,qBAAa,EAAC,aAAa,CAAC;UAC5B,IAAA,uBAAc,EAAC,UAAU,EAAE,eAAe,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,CAAC;UACpF,IAAA,uBAAc,EAAC,UAAU,EAAE,eAAe,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,CAAC;UACzE,IAAA,4BAAwB,EAAC,UAAU,EAAE,eAAe,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,CAAC;UACnF,IAAA,0CAAwB,EAAC,UAAU,EAAE,eAAe,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,CAAC;UACnF,IAAA,sCAAoB,EAAC,UAAU,EAAE,GAAG,CAAC;UACrC,IAAA,oDAA6B,EAAC,UAAU,EAAE,eAAe,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,CAAC;UACxF,IAAA,uCAAqB,EAAC,UAAU,EAAE,eAAe,EAAE,GAAG,CAAC;KAC5D,CAAC,CAAC;AACP,CAAC;AAtBD,oCAsBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NamedTypeNode, ObjectTypeDefinitionNode, TypeNode } from '@luvio/graphql-parser';
|
|
2
|
+
import type { LuvioGraphQLDSL } from '../../../intermediate/graphql';
|
|
3
|
+
import type { ImportContext } from '../../../utils/imports';
|
|
4
|
+
import type { GraphQLCodegenMetadata } from '../source-printer';
|
|
5
|
+
import type { NormalizableTypes } from '../utils';
|
|
6
|
+
export declare function generateIngestFieldDataByType(graphqlDsl: LuvioGraphQLDSL, graphqlTypeName: string, def: ObjectTypeDefinitionNode, importContext: ImportContext, _metadata: GraphQLCodegenMetadata): string;
|
|
7
|
+
export declare function ingestType(typeNode: TypeNode, importContext: ImportContext, normalizableTypeMap: NormalizableTypes): string;
|
|
8
|
+
export declare function ingestNamedType(typeNode: NamedTypeNode, importContext: ImportContext, normalizableTypeMap: NormalizableTypes): string;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ingestNamedType = exports.ingestType = exports.generateIngestFieldDataByType = void 0;
|
|
7
|
+
const deindent_1 = __importDefault(require("../../../utils/deindent"));
|
|
8
|
+
const constants_1 = require("../../shared/constants");
|
|
9
|
+
const types_1 = require("../utils/types");
|
|
10
|
+
const constants_2 = require("./constants");
|
|
11
|
+
const interface_1 = require("./interface");
|
|
12
|
+
function generateIngestFieldDataByType(graphqlDsl, graphqlTypeName, def, importContext, _metadata) {
|
|
13
|
+
const graphqlStateInterface = importContext.importGraphQLArtifact('types', constants_2.TYPE_UTIL_IDENTIFIER, constants_2.GRAPHQL_INGEST_STATE_INTERFACE_IDENTIFIER);
|
|
14
|
+
const normalizableTypeMap = (0, types_1.getNormalizableTypeMap)(graphqlDsl.schema);
|
|
15
|
+
const graphqlFields = (0, types_1.getObjectFields)(def);
|
|
16
|
+
const fieldIngestStatements = graphqlFields
|
|
17
|
+
.map((graphqlField) => {
|
|
18
|
+
return ingestType(graphqlField.type, importContext, normalizableTypeMap);
|
|
19
|
+
})
|
|
20
|
+
.filter((fieldIngestStatement) => fieldIngestStatement !== '')
|
|
21
|
+
.join('\n');
|
|
22
|
+
return `export function ${constants_2.INGEST_FIELD_BY_TYPE_IDENTIFIER}(typename: string, parentKey: string, ${constants_2.REQUESTED_FIELD_IDENTIFIER}: ${constants_1.LUVIO_GRAPHQL_FIELD_NODE_IMPORT}, ${constants_2.SINK_IDENTIFIER}: Record<string, any>, ${constants_2.FIELD_KEY_IDENTIFIER}: ${constants_1.LUVIO_SELECTION_PROPERTY_KEY_IMPORT}, ${constants_2.FIELD_DATA_IDENTIFIER}: any, state: ${graphqlStateInterface}<${interface_1.PARTIAL_INTERFACE_IDENTIFIER}>) {
|
|
23
|
+
switch(typename) {
|
|
24
|
+
${fieldIngestStatements}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
}
|
|
29
|
+
exports.generateIngestFieldDataByType = generateIngestFieldDataByType;
|
|
30
|
+
function ingestType(typeNode, importContext, normalizableTypeMap) {
|
|
31
|
+
switch (typeNode.kind) {
|
|
32
|
+
case 'NamedType':
|
|
33
|
+
return ingestNamedType(typeNode, importContext, normalizableTypeMap);
|
|
34
|
+
case 'ListType':
|
|
35
|
+
case 'NonNullType':
|
|
36
|
+
return ingestType(typeNode.type, importContext, normalizableTypeMap);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.ingestType = ingestType;
|
|
40
|
+
function ingestNamedType(typeNode, importContext, normalizableTypeMap) {
|
|
41
|
+
const graphqlTypeName = (0, types_1.resolveTypeName)(typeNode);
|
|
42
|
+
const { importGraphQLArtifact } = importContext;
|
|
43
|
+
const isScalar = normalizableTypeMap[graphqlTypeName] === undefined;
|
|
44
|
+
if (isScalar) {
|
|
45
|
+
return generateIngestScalarField(graphqlTypeName);
|
|
46
|
+
}
|
|
47
|
+
const typeNameIngestImport = importGraphQLArtifact('types', graphqlTypeName, constants_2.TYPE_INGEST_IDENTIFIER);
|
|
48
|
+
const graphqlStateInterface = importGraphQLArtifact('types', constants_2.TYPE_UTIL_IDENTIFIER, constants_2.GRAPHQL_INGEST_STATE_INTERFACE_IDENTIFIER);
|
|
49
|
+
const typeNamePartialInterfaceImport = importGraphQLArtifact('types', graphqlTypeName, interface_1.PARTIAL_INTERFACE_IDENTIFIER);
|
|
50
|
+
const fieldStateIdentifier = `${graphqlTypeName}State`;
|
|
51
|
+
return (0, deindent_1.default) `
|
|
52
|
+
case '${graphqlTypeName}': {
|
|
53
|
+
const ${fieldStateIdentifier} = {
|
|
54
|
+
...state,
|
|
55
|
+
path: {
|
|
56
|
+
parent: null,
|
|
57
|
+
propertyName: null,
|
|
58
|
+
fullPath: parentKey + '__' + ${constants_2.FIELD_KEY_IDENTIFIER}
|
|
59
|
+
},
|
|
60
|
+
data: ${constants_2.FIELD_DATA_IDENTIFIER},
|
|
61
|
+
};
|
|
62
|
+
${constants_2.SINK_IDENTIFIER}[${constants_2.FIELD_KEY_IDENTIFIER}] = ${typeNameIngestImport}(
|
|
63
|
+
${constants_2.REQUESTED_FIELD_IDENTIFIER},
|
|
64
|
+
${fieldStateIdentifier} as ${graphqlStateInterface}<${typeNamePartialInterfaceImport}>
|
|
65
|
+
) as any;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
}
|
|
70
|
+
exports.ingestNamedType = ingestNamedType;
|
|
71
|
+
function generateIngestScalarField(typename) {
|
|
72
|
+
return (0, deindent_1.default) `
|
|
73
|
+
case '${typename}': {
|
|
74
|
+
${constants_2.SINK_IDENTIFIER}[${constants_2.FIELD_KEY_IDENTIFIER}] = ${constants_2.FIELD_DATA_IDENTIFIER};
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
`;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=ingest-field-by-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ingest-field-by-type.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/type/ingest-field-by-type.ts"],"names":[],"mappings":";;;;;;AAEA,uEAA+C;AAE/C,sDAGgC;AAGhC,0CAA0F;AAC1F,2CASqB;AACrB,2CAA2D;AAE3D,SAAgB,6BAA6B,CACzC,UAA2B,EAC3B,eAAuB,EACvB,GAA6B,EAC7B,aAA4B,EAC5B,SAAiC;IAEjC,MAAM,qBAAqB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AAC;IAChD,MAAM,QAAQ,GAAG,mBAAmB,CAAC,eAAe,CAAC,KAAK,SAAS,CAAC;IAEpE,IAAI,QAAQ,EAAE;QACV,OAAO,yBAAyB,CAAC,eAAe,CAAC,CAAC;KACrD;IAED,MAAM,oBAAoB,GAAG,qBAAqB,CAC9C,OAAO,EACP,eAAe,EACf,kCAAsB,CACzB,CAAC;IAEF,MAAM,qBAAqB,GAAG,qBAAqB,CAC/C,OAAO,EACP,gCAAoB,EACpB,qDAAyC,CAC5C,CAAC;IAEF,MAAM,8BAA8B,GAAG,qBAAqB,CACxD,OAAO,EACP,eAAe,EACf,wCAA4B,CAC/B,CAAC;IAEF,MAAM,oBAAoB,GAAG,GAAG,eAAe,OAAO,CAAC;IACvD,OAAO,IAAA,kBAAQ,EAAA;gBACH,eAAe;oBACX,oBAAoB;;;;;mDAKW,gCAAoB;;wBAE/C,iCAAqB;;cAE/B,2BAAe,IAAI,gCAAoB,OAAO,oBAAoB;kBAC9D,sCAA0B;kBAC1B,oBAAoB,OAAO,qBAAqB,IAAI,8BAA8B;;;;KAI/F,CAAC;AACN,CAAC;AAlDD,0CAkDC;AAED,SAAS,yBAAyB,CAAC,QAAgB;IAC/C,OAAO,IAAA,kBAAQ,EAAA;oBACC,QAAQ;kBACV,2BAAe,IAAI,gCAAoB,OAAO,iCAAqB;;;SAG5E,CAAC;AACV,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ObjectTypeDefinitionNode } from '@luvio/graphql-parser';
|
|
2
2
|
import type { ImportContext } from '../../../utils/imports';
|
|
3
|
-
import type { NormalizableTypes } from '../utils';
|
|
4
3
|
import type { LuvioGraphQLDSL } from '../../../intermediate/graphql';
|
|
5
4
|
import type { GraphQLCodegenMetadata } from '../source-printer';
|
|
6
5
|
import type { ModelInfo } from '../../../main';
|
|
7
|
-
export declare function ingestNamedType(graphqlField: FieldDefinitionNode, typeNode: NamedTypeNode, ramlFieldName: string | undefined, importContext: ImportContext, normalizableTypeMap: NormalizableTypes): string;
|
|
8
|
-
export declare function ingestListType(graphqlField: FieldDefinitionNode, typeNode: ListTypeNode, ramlFieldName: string | undefined, importContext: ImportContext, normalizableTypeMap: NormalizableTypes): string;
|
|
9
|
-
export declare function ingestType(graphqlField: FieldDefinitionNode, typeNode: TypeNode, ramlFieldName: string | undefined, importContext: ImportContext, normalizableTypeMap: NormalizableTypes): string;
|
|
10
6
|
export declare function generateIngest(graphqlDsl: LuvioGraphQLDSL, graphqlTypeName: string, def: ObjectTypeDefinitionNode, importContext: ImportContext, _metadata: GraphQLCodegenMetadata, modelInfo: ModelInfo): string;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.generateIngest =
|
|
6
|
+
exports.generateIngest = void 0;
|
|
7
7
|
const deindent_1 = __importDefault(require("../../../utils/deindent"));
|
|
8
8
|
const constants_1 = require("../../shared/constants");
|
|
9
9
|
const utils_1 = require("../utils");
|
|
@@ -11,122 +11,12 @@ const utils_2 = require("./utils");
|
|
|
11
11
|
const convert_1 = require("./convert");
|
|
12
12
|
const constants_2 = require("./constants");
|
|
13
13
|
const interface_1 = require("./interface");
|
|
14
|
-
const
|
|
14
|
+
const FIELD_TYPE_IDENTIFIER = 'fieldType';
|
|
15
15
|
const REQUESTED_FIELDS_IDENTIFIER = 'requestedFields';
|
|
16
|
-
function
|
|
17
|
-
// omit scalar fields that are mapped to RAML fields
|
|
18
|
-
if (ramlFieldName === undefined) {
|
|
19
|
-
return (0, deindent_1.default) `
|
|
20
|
-
case '${graphqlFieldName}': {
|
|
21
|
-
${constants_2.SINK_IDENTIFIER}[${constants_2.FIELD_KEY_IDENTIFIER}] = ${constants_2.FIELD_DATA_IDENTIFIER};
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
`;
|
|
25
|
-
}
|
|
26
|
-
return '';
|
|
27
|
-
}
|
|
28
|
-
function ingestNamedType(graphqlField, typeNode, ramlFieldName, importContext, normalizableTypeMap) {
|
|
29
|
-
const graphqlTypeName = (0, utils_1.resolveTypeName)(typeNode);
|
|
30
|
-
const { importGraphQLArtifact } = importContext;
|
|
31
|
-
const isScalar = normalizableTypeMap[graphqlTypeName] === undefined;
|
|
32
|
-
const graphqlFieldName = graphqlField.name.value;
|
|
33
|
-
if (isScalar) {
|
|
34
|
-
return generateIngestScalarField(graphqlFieldName, ramlFieldName);
|
|
35
|
-
}
|
|
36
|
-
const typeNameIngestImport = importGraphQLArtifact('types', graphqlTypeName, constants_2.TYPE_INGEST_IDENTIFIER);
|
|
37
|
-
const graphqlStateInterface = importGraphQLArtifact('types', constants_2.TYPE_UTIL_IDENTIFIER, constants_2.GRAPHQL_INGEST_STATE_INTERFACE_IDENTIFIER);
|
|
38
|
-
const typeNamePartialInterfaceImport = importGraphQLArtifact('types', graphqlTypeName, interface_1.PARTIAL_INTERFACE_IDENTIFIER);
|
|
39
|
-
const fieldStateIdentifier = `${graphqlFieldName}State`;
|
|
40
|
-
return (0, deindent_1.default) `
|
|
41
|
-
case '${graphqlFieldName}': {
|
|
42
|
-
const ${fieldStateIdentifier} = {
|
|
43
|
-
...state,
|
|
44
|
-
path: {
|
|
45
|
-
parent: null,
|
|
46
|
-
propertyName: null,
|
|
47
|
-
fullPath: key + '__' + ${constants_2.FIELD_KEY_IDENTIFIER}
|
|
48
|
-
},
|
|
49
|
-
data: ${constants_2.FIELD_DATA_IDENTIFIER},
|
|
50
|
-
};
|
|
51
|
-
${constants_2.SINK_IDENTIFIER}[${constants_2.FIELD_KEY_IDENTIFIER}] = ${typeNameIngestImport}(
|
|
52
|
-
${constants_2.REQUESTED_FIELD_IDENTIFIER},
|
|
53
|
-
${fieldStateIdentifier} as ${graphqlStateInterface}<${typeNamePartialInterfaceImport}>
|
|
54
|
-
) as any;
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
`;
|
|
58
|
-
}
|
|
59
|
-
exports.ingestNamedType = ingestNamedType;
|
|
60
|
-
function ingestListType(graphqlField, typeNode, ramlFieldName, importContext, normalizableTypeMap) {
|
|
61
|
-
const { importGraphQLArtifact } = importContext;
|
|
62
|
-
const graphqlFieldName = graphqlField.name.value;
|
|
63
|
-
const graphqlTypeName = (0, utils_1.resolveTypeName)(typeNode);
|
|
64
|
-
const fullPathIdentifier = `fullPath__${graphqlFieldName}`;
|
|
65
|
-
const collectionIdentifier = `${graphqlFieldName}__items`;
|
|
66
|
-
// Non-normalizable types
|
|
67
|
-
const isScalar = normalizableTypeMap[graphqlTypeName] === undefined;
|
|
68
|
-
if (isScalar) {
|
|
69
|
-
return generateIngestScalarField(graphqlFieldName, ramlFieldName);
|
|
70
|
-
}
|
|
71
|
-
const typeNameIngestImport = importGraphQLArtifact('types', graphqlTypeName, constants_2.TYPE_INGEST_IDENTIFIER);
|
|
72
|
-
const graphqlStateInterface = importGraphQLArtifact('types', constants_2.TYPE_UTIL_IDENTIFIER, constants_2.GRAPHQL_INGEST_STATE_INTERFACE_IDENTIFIER);
|
|
73
|
-
const typeNamePartialInterfaceImport = importGraphQLArtifact('types', graphqlTypeName, interface_1.PARTIAL_INTERFACE_IDENTIFIER);
|
|
74
|
-
return (0, deindent_1.default) `
|
|
75
|
-
case '${graphqlFieldName}': {
|
|
76
|
-
const ${collectionIdentifier}: ${constants_1.LUVIO_STORE_LINK_IMPORT}[] = [];
|
|
77
|
-
const ${fullPathIdentifier} = \`\${key}__\${${constants_2.FIELD_KEY_IDENTIFIER}}\`;
|
|
78
|
-
for(let i = 0, len = ${constants_2.FIELD_DATA_IDENTIFIER}.length; i < len; i++) {
|
|
79
|
-
const item = ${constants_2.FIELD_DATA_IDENTIFIER}[i];
|
|
80
|
-
|
|
81
|
-
const itemState = {
|
|
82
|
-
...state,
|
|
83
|
-
path: {
|
|
84
|
-
parent: null,
|
|
85
|
-
propertyName: null,
|
|
86
|
-
fullPath: ${fullPathIdentifier} + i
|
|
87
|
-
},
|
|
88
|
-
data: item,
|
|
89
|
-
};
|
|
90
|
-
${collectionIdentifier}[i] = ${typeNameIngestImport}(
|
|
91
|
-
${constants_2.REQUESTED_FIELD_IDENTIFIER},
|
|
92
|
-
itemState as ${graphqlStateInterface}<${typeNamePartialInterfaceImport}>
|
|
93
|
-
) as any;
|
|
94
|
-
}
|
|
95
|
-
${constants_2.SINK_IDENTIFIER}[${constants_2.FIELD_KEY_IDENTIFIER}] = ${collectionIdentifier};
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
`;
|
|
99
|
-
}
|
|
100
|
-
exports.ingestListType = ingestListType;
|
|
101
|
-
function ingestType(graphqlField, typeNode, ramlFieldName, importContext, normalizableTypeMap) {
|
|
102
|
-
if (graphqlField === undefined) {
|
|
103
|
-
return '';
|
|
104
|
-
}
|
|
105
|
-
switch (typeNode.kind) {
|
|
106
|
-
case 'NamedType':
|
|
107
|
-
return ingestNamedType(graphqlField, typeNode, ramlFieldName, importContext, normalizableTypeMap);
|
|
108
|
-
case 'ListType':
|
|
109
|
-
return ingestListType(graphqlField, typeNode, ramlFieldName, importContext, normalizableTypeMap);
|
|
110
|
-
default:
|
|
111
|
-
return ingestType(graphqlField, typeNode.type, ramlFieldName, importContext, normalizableTypeMap);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
exports.ingestType = ingestType;
|
|
115
|
-
function generateObjectTypeIngest(graphqlDsl, graphqlTypeName, importContext, def, normalizableTypeMap) {
|
|
116
|
-
const graphqlFields = (0, types_1.getObjectFields)(def);
|
|
117
|
-
const fieldIngestStatements = graphqlFields
|
|
118
|
-
.filter((graphqlField) => graphqlField.type !== undefined)
|
|
119
|
-
.map((graphqlField) => {
|
|
120
|
-
const { typeNameToExtensions } = graphqlDsl;
|
|
121
|
-
const graphqlFieldName = graphqlField.name.value;
|
|
122
|
-
const ramlFieldName = (0, utils_2.getRamlFieldName)(typeNameToExtensions, graphqlTypeName, graphqlFieldName);
|
|
123
|
-
return ingestType(graphqlField, graphqlField.type, ramlFieldName, importContext, normalizableTypeMap);
|
|
124
|
-
})
|
|
125
|
-
.filter((fieldIngestStatement) => fieldIngestStatement !== '');
|
|
126
|
-
const eachFieldHandling = fieldIngestStatements.join('\n');
|
|
16
|
+
function generateObjectTypeIngest(importContext) {
|
|
127
17
|
const ingestStatements = [
|
|
128
18
|
getRequestedFieldsStatement(importContext),
|
|
129
|
-
iterateThroughResponseKeys(importContext
|
|
19
|
+
iterateThroughResponseKeys(importContext),
|
|
130
20
|
];
|
|
131
21
|
return ingestStatements.join('\n');
|
|
132
22
|
}
|
|
@@ -139,7 +29,7 @@ function getRequestedFieldsStatement(importContext) {
|
|
|
139
29
|
[];
|
|
140
30
|
`;
|
|
141
31
|
}
|
|
142
|
-
function iterateThroughResponseKeys(importContext
|
|
32
|
+
function iterateThroughResponseKeys(importContext) {
|
|
143
33
|
const getRequestedFieldImport = importContext.importGraphQLArtifact('types', constants_2.TYPE_UTIL_IDENTIFIER, constants_2.GET_REQUESTED_FIELD_IDENTIFIER);
|
|
144
34
|
const getFieldKeyImport = importContext.importGraphQLArtifact('types', constants_2.TYPE_UTIL_IDENTIFIER, constants_2.GET_SERIALIZED_KEY_FOR_FIELD_IDENTIFIER);
|
|
145
35
|
return (0, deindent_1.default) `
|
|
@@ -150,11 +40,24 @@ function iterateThroughResponseKeys(importContext, individualFieldIngestBlock) {
|
|
|
150
40
|
if(${constants_2.REQUESTED_FIELD_IDENTIFIER} === undefined) {
|
|
151
41
|
break; // TODO: (W-11132802) We got a field back we didn't ask for. Call handleUnknownField.
|
|
152
42
|
}
|
|
43
|
+
if(${constants_2.IS_MAPPED_FIELD_IDENTIFIER}(${constants_2.REQUESTED_FIELD_IDENTIFIER})) {
|
|
44
|
+
continue; // Skips scalar fields that are mapped to RAML.
|
|
45
|
+
}
|
|
153
46
|
const ${constants_2.FIELD_KEY_IDENTIFIER} = ${getFieldKeyImport}(${constants_2.REQUESTED_FIELD_IDENTIFIER}, state.variables);
|
|
47
|
+
const ${FIELD_TYPE_IDENTIFIER} = ${constants_2.GET_FIELD_TYPE_IDENTIFIER}(${constants_2.REQUESTED_FIELD_IDENTIFIER});
|
|
154
48
|
|
|
155
|
-
|
|
156
|
-
${
|
|
157
|
-
|
|
49
|
+
if(${FIELD_TYPE_IDENTIFIER}.isArray && ${constants_2.FIELD_DATA_IDENTIFIER} !== null && ${constants_2.FIELD_DATA_IDENTIFIER}.length !== undefined) {
|
|
50
|
+
const arrayLength = ${constants_2.FIELD_DATA_IDENTIFIER}.length;
|
|
51
|
+
const arraySink: any[] = new Array(arrayLength);
|
|
52
|
+
for(let i = 0, len = arrayLength; i < len; i += 1) {
|
|
53
|
+
const arrayFullPathKey = key + '__' + ${constants_2.FIELD_KEY_IDENTIFIER}
|
|
54
|
+
ingestFieldByType(${FIELD_TYPE_IDENTIFIER}.typename, arrayFullPathKey, ${constants_2.REQUESTED_FIELD_IDENTIFIER}, arraySink, i, ${constants_2.FIELD_DATA_IDENTIFIER}[i], state)
|
|
55
|
+
}
|
|
56
|
+
sink[fieldKey] = arraySink;
|
|
57
|
+
} else {
|
|
58
|
+
ingestFieldByType(${FIELD_TYPE_IDENTIFIER}.typename, key, ${constants_2.REQUESTED_FIELD_IDENTIFIER}, ${constants_2.SINK_IDENTIFIER}, ${constants_2.FIELD_KEY_IDENTIFIER}, ${constants_2.FIELD_DATA_IDENTIFIER}, state)
|
|
59
|
+
|
|
60
|
+
}
|
|
158
61
|
}
|
|
159
62
|
`;
|
|
160
63
|
}
|
|
@@ -172,7 +75,7 @@ function generateIngest(graphqlDsl, graphqlTypeName, def, importContext, _metada
|
|
|
172
75
|
const astNodeParamType = ((_a = schema.getQueryType()) === null || _a === void 0 ? void 0 : _a.name) === graphqlTypeName
|
|
173
76
|
? constants_1.LUVIO_GRAPHQL_OPERATION_DEFINITION_NODE_IMPORT
|
|
174
77
|
: constants_1.LUVIO_GRAPHQL_FIELD_NODE_IMPORT;
|
|
175
|
-
const
|
|
78
|
+
const convertToRaml = (0, convert_1.generateRamlConversion)(graphqlDsl, graphqlTypeName, importContext, def, modelInfo, graphqlStateInterface, normalizableTypeMap);
|
|
176
79
|
let ramlIngest = undefined;
|
|
177
80
|
const ramlTypeName = (0, utils_2.getRamlTypeName)(typeNameToExtensions, graphqlTypeName);
|
|
178
81
|
if (ramlTypeName !== undefined) {
|
|
@@ -183,15 +86,15 @@ function generateIngest(graphqlDsl, graphqlTypeName, def, importContext, _metada
|
|
|
183
86
|
}
|
|
184
87
|
return (0, deindent_1.default) `
|
|
185
88
|
|
|
186
|
-
${
|
|
89
|
+
${convertToRaml}
|
|
187
90
|
|
|
188
91
|
export function ingest(astNode: ${astNodeParamType}, state: ${graphqlStateInterface}<${interface_1.PARTIAL_INTERFACE_IDENTIFIER}>) {
|
|
189
92
|
const { path, data, ${constants_1.LUVIO_IDENTIFIER}, ${constants_1.LUVIO_STORE_IDENTIFIER}, ${constants_2.TIMESTAMP_IDENTIFIER} } = state;
|
|
190
93
|
const key = ${constants_2.KEY_BUILDER_IDENTIFIER}(${constants_1.LUVIO_IDENTIFIER}, path, data);
|
|
191
94
|
const ${constants_2.SINK_IDENTIFIER}: Record<string,any> = {};
|
|
192
95
|
|
|
193
|
-
//
|
|
194
|
-
${generateObjectTypeIngest(
|
|
96
|
+
// ingest field data
|
|
97
|
+
${generateObjectTypeIngest(importContext)}
|
|
195
98
|
|
|
196
99
|
// merge existing cache data and new request response data
|
|
197
100
|
let mergedData: Record<string,any>;
|
|
@@ -203,7 +106,7 @@ function generateIngest(graphqlDsl, graphqlTypeName, def, importContext, _metada
|
|
|
203
106
|
mergedData = {data: ${constants_2.SINK_IDENTIFIER}};
|
|
204
107
|
}
|
|
205
108
|
|
|
206
|
-
${
|
|
109
|
+
${convertToRaml === ''
|
|
207
110
|
? ''
|
|
208
111
|
: (0, deindent_1.default) `
|
|
209
112
|
// delegate type ingest to RAML ingest if the type is in RAML mapping
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingest.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/type/ingest.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"ingest.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/type/ingest.ts"],"names":[],"mappings":";;;;;;AACA,uEAA+C;AAE/C,sDAKgC;AAChC,oCAAkD;AAClD,mCAAuF;AACvF,uCAAmD;AACnD,2CAiBqB;AAGrB,2CAA2D;AAG3D,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAC1C,MAAM,2BAA2B,GAAG,iBAAiB,CAAC;AAEtD,SAAS,wBAAwB,CAAC,aAA4B;IAC1D,MAAM,gBAAgB,GAAa;QAC/B,2BAA2B,CAAC,aAAa,CAAC;QAC1C,0BAA0B,CAAC,aAAa,CAAC;KAC5C,CAAC;IAEF,OAAO,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,2BAA2B,CAAC,aAA4B;IAC7D,MAAM,wBAAwB,GAAG,aAAa,CAAC,qBAAqB,CAChE,OAAO,EACP,gCAAoB,EACpB,oDAAwC,CAC3C,CAAC;IACF,OAAO,IAAA,kBAAQ,EAAA;gBACH,2BAA2B,KAAK,2CAA+B;;cAEjE,wBAAwB;;KAEjC,CAAC;AACN,CAAC;AAED,SAAS,0BAA0B,CAAC,aAA4B;IAC5D,MAAM,uBAAuB,GAAG,aAAa,CAAC,qBAAqB,CAC/D,OAAO,EACP,gCAAoB,EACpB,0CAA8B,CACjC,CAAC;IACF,MAAM,iBAAiB,GAAG,aAAa,CAAC,qBAAqB,CACzD,OAAO,EACP,gCAAoB,EACpB,mDAAuC,CAC1C,CAAC;IACF,OAAO,IAAA,kBAAQ,EAAA;oBACC,qCAAyB;oBACzB,iCAAqB,WAAW,qCAAyB;oBACzD,sCAA0B,MAAM,uBAAuB,IAAI,qCAAyB,KAAK,2BAA2B;;iBAE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
|
3
|
+
export declare function generateIsMappedField(graphqlDsl: LuvioGraphQLDSL, graphqlTypeName: string, def: ObjectTypeDefinitionNode): string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateIsMappedField = void 0;
|
|
4
|
+
const constants_1 = require("../../shared/constants");
|
|
5
|
+
const types_1 = require("../utils/types");
|
|
6
|
+
const constants_2 = require("./constants");
|
|
7
|
+
const utils_1 = require("./utils");
|
|
8
|
+
function getMappedScalarFieldNames(graphqlDsl, graphqlTypeName, def) {
|
|
9
|
+
const { typeNameToExtensions, schema } = graphqlDsl;
|
|
10
|
+
const normalizableTypeMap = (0, types_1.getNormalizableTypeMap)(schema);
|
|
11
|
+
const graphqlFields = (0, types_1.getObjectFields)(def);
|
|
12
|
+
return graphqlFields
|
|
13
|
+
.filter(
|
|
14
|
+
// Filter to only mapped fields
|
|
15
|
+
(graphqlField) => (0, utils_1.getRamlFieldName)(typeNameToExtensions, graphqlTypeName, graphqlField.name.value) !==
|
|
16
|
+
undefined)
|
|
17
|
+
.filter(
|
|
18
|
+
// Filter to only scalar fields. Normalized fields might have their own mapping
|
|
19
|
+
(graphqlField) => {
|
|
20
|
+
const typename = (0, types_1.resolveTypeName)(graphqlField.type);
|
|
21
|
+
return normalizableTypeMap[typename] === undefined;
|
|
22
|
+
})
|
|
23
|
+
.map((graphqlField) => graphqlField.name.value);
|
|
24
|
+
}
|
|
25
|
+
function generateIsMappedField(graphqlDsl, graphqlTypeName, def) {
|
|
26
|
+
const mappedFields = getMappedScalarFieldNames(graphqlDsl, graphqlTypeName, def);
|
|
27
|
+
const functionBody = mappedFields.length > 0
|
|
28
|
+
? `
|
|
29
|
+
const mappedFields = [${mappedFields.map((field) => `'${field}'`).join(',')}];
|
|
30
|
+
return mappedFields.indexOf(field.name.value) !== -1;`
|
|
31
|
+
: `return false`;
|
|
32
|
+
return `export function ${constants_2.IS_MAPPED_FIELD_IDENTIFIER}(field: ${constants_1.LUVIO_GRAPHQL_FIELD_NODE_IMPORT}): boolean {
|
|
33
|
+
${functionBody}
|
|
34
|
+
}`;
|
|
35
|
+
}
|
|
36
|
+
exports.generateIsMappedField = generateIsMappedField;
|
|
37
|
+
//# sourceMappingURL=is-mapped-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-mapped-field.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/type/is-mapped-field.ts"],"names":[],"mappings":";;;AAEA,sDAAyE;AACzE,0CAA0F;AAC1F,2CAAyD;AACzD,mCAA2C;AAE3C,SAAS,yBAAyB,CAC9B,UAA2B,EAC3B,eAAuB,EACvB,GAA6B;IAE7B,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;IACpD,MAAM,mBAAmB,GAAG,IAAA,8BAAsB,EAAC,MAAM,CAAC,CAAC;IAC3D,MAAM,aAAa,GAAG,IAAA,uBAAe,EAAC,GAAG,CAAC,CAAC;IAE3C,OAAO,aAAa;SACf,MAAM;IACH,+BAA+B;IAC/B,CAAC,YAAY,EAAE,EAAE,CACb,IAAA,wBAAgB,EAAC,oBAAoB,EAAE,eAAe,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;QAChF,SAAS,CAChB;SACA,MAAM;IACH,+EAA+E;IAC/E,CAAC,YAAY,EAAE,EAAE;QACb,MAAM,QAAQ,GAAG,IAAA,uBAAe,EAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACpD,OAAO,mBAAmB,CAAC,QAAQ,CAAC,KAAK,SAAS,CAAC;IACvD,CAAC,CACJ;SACA,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACxD,CAAC;AAED,SAAgB,qBAAqB,CACjC,UAA2B,EAC3B,eAAuB,EACvB,GAA6B;IAE7B,MAAM,YAAY,GAAG,yBAAyB,CAAC,UAAU,EAAE,eAAe,EAAE,GAAG,CAAC,CAAC;IAEjF,MAAM,YAAY,GACd,YAAY,CAAC,MAAM,GAAG,CAAC;QACnB,CAAC,CAAC;gCACkB,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;8DACrB;QAClD,CAAC,CAAC,cAAc,CAAC;IAEzB,OAAO,mBAAmB,sCAA0B,WAAW,2CAA+B;UACxF,YAAY;MAChB,CAAC;AACP,CAAC;AAjBD,sDAiBC"}
|
|
@@ -2,4 +2,4 @@ import type { ObjectTypeDefinitionNode } from '@luvio/graphql-parser';
|
|
|
2
2
|
import type { ImportContext } from '../../../utils/imports';
|
|
3
3
|
import type { LuvioGraphQLDSL } from '../../../intermediate/graphql';
|
|
4
4
|
import type { GraphQLCodegenMetadata } from '../source-printer';
|
|
5
|
-
export declare function generateSelect(graphqlDsl: LuvioGraphQLDSL, graphqlTypeName: string, def: ObjectTypeDefinitionNode, importContext: ImportContext,
|
|
5
|
+
export declare function generateSelect(graphqlDsl: LuvioGraphQLDSL, graphqlTypeName: string, def: ObjectTypeDefinitionNode, importContext: ImportContext, _metadata: GraphQLCodegenMetadata): string;
|
|
@@ -13,7 +13,6 @@ const utils_2 = require("../utils");
|
|
|
13
13
|
const types_1 = require("../utils/types");
|
|
14
14
|
const interface_1 = require("./interface");
|
|
15
15
|
const util_1 = require("../directive/util");
|
|
16
|
-
const type_from_field_1 = require("./type-from-field");
|
|
17
16
|
function selectNamedType(field, typeNode, importContext, normalizableTypeMap) {
|
|
18
17
|
const fieldName = field.name.value;
|
|
19
18
|
const identifier = fieldName;
|
|
@@ -94,7 +93,7 @@ function generateDataMapping(graphqlDsl, graphqlTypeName, def, normalizableTypeM
|
|
|
94
93
|
.filter((fieldIngestStatement) => fieldIngestStatement !== '')
|
|
95
94
|
.join('\n');
|
|
96
95
|
}
|
|
97
|
-
function generateSelect(graphqlDsl, graphqlTypeName, def, importContext,
|
|
96
|
+
function generateSelect(graphqlDsl, graphqlTypeName, def, importContext, _metadata) {
|
|
98
97
|
var _a;
|
|
99
98
|
const { schema } = graphqlDsl;
|
|
100
99
|
const type = schema.getType(def.name.value);
|
|
@@ -106,10 +105,10 @@ function generateSelect(graphqlDsl, graphqlTypeName, def, importContext, metadat
|
|
|
106
105
|
const fieldSelectionByTypeCaseStatements = (0, types_1.getObjectFields)(def)
|
|
107
106
|
.map((field) => {
|
|
108
107
|
const type = field.type;
|
|
109
|
-
const typename = (0,
|
|
108
|
+
const typename = (0, types_1.resolveTypeName)(type);
|
|
110
109
|
const body = selectType(field, type, importContext, normalizableTypeMap);
|
|
111
110
|
return (0, deindent_1.default) `
|
|
112
|
-
case ${typename}: {
|
|
111
|
+
case '${typename}': {
|
|
113
112
|
${body}
|
|
114
113
|
break;
|
|
115
114
|
}
|
|
@@ -136,7 +135,7 @@ function generateSelect(graphqlDsl, graphqlTypeName, def, importContext, metadat
|
|
|
136
135
|
}
|
|
137
136
|
}
|
|
138
137
|
}
|
|
139
|
-
function selectType(typename: string, sel: ${constants_2.LUVIO_GRAPHQL_FIELD_NODE_IMPORT}, fieldData: any, reader: ${constants_1.ADAPTER_READER_IMPORT}<any>, key: ${constants_2.LUVIO_SELECTION_PROPERTY_KEY_IMPORT}, sink: any, variables: ${graphqlVariablesImport}, fragments: ${fragmentMapImport}) {
|
|
138
|
+
export function selectType(typename: string, sel: ${constants_2.LUVIO_GRAPHQL_FIELD_NODE_IMPORT}, fieldData: any, reader: ${constants_1.ADAPTER_READER_IMPORT}<any>, key: ${constants_2.LUVIO_SELECTION_PROPERTY_KEY_IMPORT}, sink: any, variables: ${graphqlVariablesImport}, fragments: ${fragmentMapImport}) {
|
|
140
139
|
switch(typename) {
|
|
141
140
|
${fieldSelectionByTypeCaseStatements}
|
|
142
141
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/type/select.ts"],"names":[],"mappings":";;;;;;AAAA,uEAA+C;AAC/C,uDAAgE;AAQhE,sDAKgC;AAGhC,2CAUqB;AACrB,mCAA2C;AAE3C,oCAAkD;AAClD,0CAAkE;AAClE,2CAA2D;AAC3D,4CAG2B;
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/type/select.ts"],"names":[],"mappings":";;;;;;AAAA,uEAA+C;AAC/C,uDAAgE;AAQhE,sDAKgC;AAGhC,2CAUqB;AACrB,mCAA2C;AAE3C,oCAAkD;AAClD,0CAAkE;AAClE,2CAA2D;AAC3D,4CAG2B;AAE3B,SAAS,eAAe,CACpB,KAA0B,EAC1B,QAAuB,EACvB,aAA4B,EAC5B,mBAAsC;IAEtC,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;IACnC,MAAM,UAAU,GAAG,SAAS,CAAC;IAC7B,MAAM,sBAAsB,GAAG,GAAG,UAAU,cAAc,CAAC;IAC3D,MAAM,eAAe,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IAC5C,MAAM,QAAQ,GAAG,mBAAmB,CAAC,eAAe,CAAC,KAAK,SAAS,CAAC;IAEpE,mBAAmB;IACnB,IAAI,QAAQ,EAAE;QACV,OAAO,oBAAoB,EAAE,CAAC;KACjC;IACD,MAAM,eAAe,GAAG,aAAa,CAAC,qBAAqB,CACvD,OAAO,EACP,QAAQ,CAAC,IAAI,CAAC,KAAK,EACnB,QAAQ,CACX,CAAC;IACF,MAAM,yBAAyB,GAAG,aAAa,CAAC,qBAAqB,CACjE,OAAO,EACP,QAAQ,CAAC,IAAI,CAAC,KAAK,EACnB,kBAAkB,CACrB,CAAC;IAEF,OAAO,IAAA,kBAAQ,EAAA;gBACH,sBAAsB;wBACd,iCAAqB;;;;;;;;cAQ/B,sBAAsB;6BACP,eAAe,+BAA+B,sBAAsB,YAAY,yBAAyB;qCACjG,2BAAe;;;;KAI/C,CAAC;A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B;;sDAEtC,iCAAqB,aAAa,2CAA+B,KAAK,2BAAe;;;;;wDAKnF,wCAA4B,aAAa,iCAAqB,yBAAyB,+CAAmC,iBAAiB,sBAAsB,gBAAgB,iBAAiB;oBACtO,2BAAe;;kDAEe,aAAa,CAAC,qBAAqB,CACjE,YAAY,EACZ,uCAAgC,EAChC,gDAAyC,CAC5C;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA2BI,2BAAe;;wCAEI,gBAAgB,gBAAgB,sBAAsB,gBAAgB,iBAAiB;8BACjG,wCAA4B,aAAa,iCAAqB,WAAW,wCAA4B;wBAC3G,2BAAe;;;;;;;;;;;;;;;;;yBAiBd,2BAAe,OAAO,wCAA4B;;;KAGtE,CAAC;AACN,CAAC;AAxJD,wCAwJC;AAED,SAAS,oBAAoB;IACzB,OAAO,IAAA,kBAAQ,EAAA;mCACgB,2BAAe,KAAK,iCAAqB;KACvE,CAAC;AACN,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import type { ObjectTypeDefinitionNode
|
|
1
|
+
import type { ObjectTypeDefinitionNode } from '@luvio/graphql-parser';
|
|
2
2
|
import type { LuvioGraphQLDSL } from '../../../intermediate/graphql';
|
|
3
|
-
|
|
4
|
-
import type { GraphQLCodegenMetadata } from '../source-printer';
|
|
5
|
-
export declare function generateGetFieldType(graphqlDsl: LuvioGraphQLDSL, def: ObjectTypeDefinitionNode, importContext: ImportContext, metadata: GraphQLCodegenMetadata): string;
|
|
6
|
-
export declare function getTypeName(type: TypeNode, importContext: ImportContext, scalarToPrimitiveMap: Record<string, string>): string;
|
|
3
|
+
export declare function generateGetFieldType(graphqlDsl: LuvioGraphQLDSL, def: ObjectTypeDefinitionNode): string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.generateGetFieldType = void 0;
|
|
4
4
|
const constants_1 = require("../../shared/constants");
|
|
5
5
|
const types_1 = require("../utils/types");
|
|
6
6
|
const constants_2 = require("./constants");
|
|
7
|
-
function generateGetFieldType(graphqlDsl, def
|
|
7
|
+
function generateGetFieldType(graphqlDsl, def) {
|
|
8
8
|
const { schema } = graphqlDsl;
|
|
9
9
|
const type = schema.getType(def.name.value);
|
|
10
10
|
if (!type) {
|
|
@@ -15,12 +15,12 @@ function generateGetFieldType(graphqlDsl, def, importContext, metadata) {
|
|
|
15
15
|
const fieldName = field.name.value;
|
|
16
16
|
const type = field.type;
|
|
17
17
|
const isArrayAsString = isListType(type) ? 'true' : 'false';
|
|
18
|
-
const typeName =
|
|
18
|
+
const typeName = (0, types_1.resolveTypeName)(type);
|
|
19
19
|
return `
|
|
20
20
|
case '${fieldName}': {
|
|
21
21
|
return {
|
|
22
22
|
isArray: ${isArrayAsString},
|
|
23
|
-
typename: ${typeName}
|
|
23
|
+
typename: '${typeName}'
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
`;
|
|
@@ -46,21 +46,4 @@ function isListType(type) {
|
|
|
46
46
|
return isListType(type.type);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
function getTypeName(type, importContext, scalarToPrimitiveMap) {
|
|
50
|
-
switch (type.kind) {
|
|
51
|
-
case 'ListType':
|
|
52
|
-
case 'NonNullType':
|
|
53
|
-
return getTypeName(type.type, importContext, scalarToPrimitiveMap);
|
|
54
|
-
case 'NamedType':
|
|
55
|
-
return generateNamedTypeReference(type, importContext, scalarToPrimitiveMap);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.getTypeName = getTypeName;
|
|
59
|
-
function generateNamedTypeReference(type, importContext, scalarToPrimitiveMap) {
|
|
60
|
-
const typeName = type.name.value;
|
|
61
|
-
if (scalarToPrimitiveMap[typeName] !== undefined) {
|
|
62
|
-
return `'${scalarToPrimitiveMap[typeName]}'`;
|
|
63
|
-
}
|
|
64
|
-
return importContext.importGraphQLArtifact('types', typeName, 'name');
|
|
65
|
-
}
|
|
66
49
|
//# sourceMappingURL=type-from-field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-from-field.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/type/type-from-field.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"type-from-field.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/type/type-from-field.ts"],"names":[],"mappings":";;;AAEA,sDAAyE;AACzE,0CAAkE;AAClE,2CAAwD;AAExD,SAAgB,oBAAoB,CAAC,UAA2B,EAAE,GAA6B;IAC3F,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;IAC9B,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5C,IAAI,CAAC,IAAI,EAAE;QACP,OAAO,EAAE,CAAC;KACb;IAED,MAAM,mBAAmB,GAAG,IAAA,uBAAe,EAAC,GAAG,CAAC;SAC3C,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACX,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;QACnC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACxB,MAAM,eAAe,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;QAC5D,MAAM,QAAQ,GAAG,IAAA,uBAAe,EAAC,IAAI,CAAC,CAAC;QAEvC,OAAO;wBACK,SAAS;;mCAEE,eAAe;qCACb,QAAQ;;;aAGhC,CAAC;IACN,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;IAEhB,OAAO,mBAAmB,qCAAyB,WAAW,2CAA+B;;kBAE/E,mBAAmB;;;;;SAK5B,CAAC;AACV,CAAC;AAjCD,oDAiCC;AAED,SAAS,UAAU,CAAC,IAAc;IAC9B,QAAQ,IAAI,CAAC,IAAI,EAAE;QACf,KAAK,UAAU;YACX,OAAO,IAAI,CAAC;QAChB,KAAK,WAAW;YACZ,OAAO,KAAK,CAAC;QACjB,KAAK,aAAa;YACd,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACpC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luvio/compiler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.98.0",
|
|
4
4
|
"description": "Luvio Compiler",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"types": "dist/main.d.ts",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"resources/"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@luvio/graphql-parser": "0.
|
|
34
|
+
"@luvio/graphql-parser": "0.98.0",
|
|
35
35
|
"amf-client-js": "4.2.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@luvio/adapter-test-library": "0.
|
|
39
|
-
"@luvio/engine": "0.
|
|
38
|
+
"@luvio/adapter-test-library": "0.98.0",
|
|
39
|
+
"@luvio/engine": "0.98.0"
|
|
40
40
|
}
|
|
41
41
|
}
|