From c44dc0cc3b24be5c84f3219de1a51e1c42cd540b Mon Sep 17 00:00:00 2001 From: Vitalii Bedletskyi <70570504+VitaliiBedletskyi@users.noreply.github.com> Date: Tue, 28 Jan 2025 18:14:56 +0200 Subject: [PATCH] HCK-9651, HCK-9652, HCK-9659: fix issues related to type selector in GraphQL (#46) * enable disabled tests * add enhanced configs for types in arguments properties --- .../field_level/fieldLevelConfig.json | 180 ++++++++++++++++-- .../mappers/arguments.spec.js | 4 +- 2 files changed, 170 insertions(+), 14 deletions(-) diff --git a/properties_pane/field_level/fieldLevelConfig.json b/properties_pane/field_level/fieldLevelConfig.json index bfcb648..2a0d626 100644 --- a/properties_pane/field_level/fieldLevelConfig.json +++ b/properties_pane/field_level/fieldLevelConfig.json @@ -1369,7 +1369,20 @@ making sure that you maintain a proper JSON format. }, "options": { "useAllDefinitionsAsSource": true, - "includeTargetTypes": true + "groupBy": "childType", + "includeTargetTypes": { + "excludeTypes": [ + "List", + "enum", + "input", + "scalar", + "union", + "object", + "interface", + "union", + "directive" + ] + } } } } @@ -1482,7 +1495,20 @@ making sure that you maintain a proper JSON format. }, "options": { "useAllDefinitionsAsSource": true, - "includeTargetTypes": true + "groupBy": "childType", + "includeTargetTypes": { + "excludeTypes": [ + "List", + "enum", + "input", + "scalar", + "union", + "object", + "interface", + "union", + "directive" + ] + } } } } @@ -1595,7 +1621,20 @@ making sure that you maintain a proper JSON format. }, "options": { "useAllDefinitionsAsSource": true, - "includeTargetTypes": true + "groupBy": "childType", + "includeTargetTypes": { + "excludeTypes": [ + "List", + "enum", + "input", + "scalar", + "union", + "object", + "interface", + "union", + "directive" + ] + } } } } @@ -1708,7 +1747,20 @@ making sure that you maintain a proper JSON format. }, "options": { "useAllDefinitionsAsSource": true, - "includeTargetTypes": true + "groupBy": "childType", + "includeTargetTypes": { + "excludeTypes": [ + "List", + "enum", + "input", + "scalar", + "union", + "object", + "interface", + "union", + "directive" + ] + } } } } @@ -1821,7 +1873,20 @@ making sure that you maintain a proper JSON format. }, "options": { "useAllDefinitionsAsSource": true, - "includeTargetTypes": true + "groupBy": "childType", + "includeTargetTypes": { + "excludeTypes": [ + "List", + "enum", + "input", + "scalar", + "union", + "object", + "interface", + "union", + "directive" + ] + } } } } @@ -1934,7 +1999,20 @@ making sure that you maintain a proper JSON format. }, "options": { "useAllDefinitionsAsSource": true, - "includeTargetTypes": true + "groupBy": "childType", + "includeTargetTypes": { + "excludeTypes": [ + "List", + "enum", + "input", + "scalar", + "union", + "object", + "interface", + "union", + "directive" + ] + } } } } @@ -2048,7 +2126,20 @@ making sure that you maintain a proper JSON format. }, "options": { "useAllDefinitionsAsSource": true, - "includeTargetTypes": true + "groupBy": "childType", + "includeTargetTypes": { + "excludeTypes": [ + "List", + "enum", + "input", + "scalar", + "union", + "object", + "interface", + "union", + "directive" + ] + } } } } @@ -2171,7 +2262,20 @@ making sure that you maintain a proper JSON format. }, "options": { "useAllDefinitionsAsSource": true, - "includeTargetTypes": true + "groupBy": "childType", + "includeTargetTypes": { + "excludeTypes": [ + "List", + "enum", + "input", + "scalar", + "union", + "object", + "interface", + "union", + "directive" + ] + } } } } @@ -2294,7 +2398,20 @@ making sure that you maintain a proper JSON format. }, "options": { "useAllDefinitionsAsSource": true, - "includeTargetTypes": true + "groupBy": "childType", + "includeTargetTypes": { + "excludeTypes": [ + "List", + "enum", + "input", + "scalar", + "union", + "object", + "interface", + "union", + "directive" + ] + } } } } @@ -2417,7 +2534,20 @@ making sure that you maintain a proper JSON format. }, "options": { "useAllDefinitionsAsSource": true, - "includeTargetTypes": true + "groupBy": "childType", + "includeTargetTypes": { + "excludeTypes": [ + "List", + "enum", + "input", + "scalar", + "union", + "object", + "interface", + "union", + "directive" + ] + } } } } @@ -2525,7 +2655,20 @@ making sure that you maintain a proper JSON format. }, "options": { "useAllDefinitionsAsSource": true, - "includeTargetTypes": true + "groupBy": "childType", + "includeTargetTypes": { + "excludeTypes": [ + "List", + "enum", + "input", + "scalar", + "union", + "object", + "interface", + "union", + "directive" + ] + } } } } @@ -2632,7 +2775,20 @@ making sure that you maintain a proper JSON format. }, "options": { "useAllDefinitionsAsSource": true, - "includeTargetTypes": true + "groupBy": "childType", + "includeTargetTypes": { + "excludeTypes": [ + "List", + "enum", + "input", + "scalar", + "union", + "object", + "interface", + "union", + "directive" + ] + } } } } diff --git a/test/forward_engineering/mappers/arguments.spec.js b/test/forward_engineering/mappers/arguments.spec.js index d7d6be0..97a0175 100644 --- a/test/forward_engineering/mappers/arguments.spec.js +++ b/test/forward_engineering/mappers/arguments.spec.js @@ -159,7 +159,7 @@ describe('getArguments', () => { strictEqual(result, '(arg1: String, arg2: Int)'); }); - it.skip('should return formatted arguments if descriptions are present', () => { + it('should return formatted arguments if descriptions are present', () => { const graphqlArguments = [ { name: 'arg1', type: 'String', description: 'Argument description 1' }, { name: 'arg2', type: 'Int', description: 'Argument description 2' }, @@ -176,7 +176,7 @@ describe('getArguments', () => { strictEqual(result, '(arg1: String, arg2: Int)'); }); - it.skip("should skip arguments which don't have name or type or both", () => { + it("should skip arguments which don't have name or type or both", () => { const graphqlArguments = [ { type: 'String' }, // missing name { name: 'arg2' }, // missing type