From 896c22c12280bc6f5a6d0066a2b2d935a0ccf281 Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Fri, 27 Sep 2024 10:47:08 +0530 Subject: [PATCH] remove kind field from __Field and add more fields to __Type in the test --- .../expected/issue_557_1_to_1_nullability.out | 192 +++++++++++++++--- test/sql/issue_557_1_to_1_nullability.sql | 11 +- 2 files changed, 176 insertions(+), 27 deletions(-) diff --git a/test/expected/issue_557_1_to_1_nullability.out b/test/expected/issue_557_1_to_1_nullability.out index f87dc3cc..1667aeb3 100644 --- a/test/expected/issue_557_1_to_1_nullability.out +++ b/test/expected/issue_557_1_to_1_nullability.out @@ -26,6 +26,9 @@ begin; fields { name type { + name + kind + description ofType { name kind @@ -48,43 +51,58 @@ begin; { + "name": "nodeId", + "type": { + + "kind": "NON_NULL", + + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "description": "A globally unique identifier for a given record"+ - } + + }, + + "description": null + } + }, + { + "name": "id", + "type": { + + "kind": "NON_NULL", + + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "UUID", + "description": "A universally unique identifier" + - } + + }, + + "description": null + } + }, + { + "name": "kind", + "type": { + + "kind": "NON_NULL", + + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "description": "A string" + - } + + }, + + "description": null + } + }, + { + "name": "contact", + "type": { + - "ofType": null + + "kind": "OBJECT", + + "name": "Contact", + + "ofType": null, + + "description": null + } + }, + { + "name": "organization", + "type": { + - "ofType": null + + "kind": "OBJECT", + + "name": "Organization", + + "ofType": null, + + "description": null + } + } + ] + @@ -101,9 +119,11 @@ begin; kind fields { name - kind description type { + name + kind + description ofType { name kind @@ -115,15 +135,72 @@ begin; } $$) ); - jsonb_pretty --------------------------------------------------------- - { + - "data": null, + - "errors": [ + - { + - "message": "unknown field in __Field kind"+ - } + - ] + + jsonb_pretty +---------------------------------------------------------------------------------------------- + { + + "data": { + + "__type": { + + "kind": "OBJECT", + + "fields": [ + + { + + "name": "nodeId", + + "type": { + + "kind": "NON_NULL", + + "name": null, + + "ofType": { + + "kind": "SCALAR", + + "name": "ID", + + "description": "A globally unique identifier for a given record"+ + }, + + "description": null + + }, + + "description": "Globally Unique Record Identifier" + + }, + + { + + "name": "id", + + "type": { + + "kind": "NON_NULL", + + "name": null, + + "ofType": { + + "kind": "SCALAR", + + "name": "UUID", + + "description": "A universally unique identifier" + + }, + + "description": null + + }, + + "description": null + + }, + + { + + "name": "name", + + "type": { + + "kind": "NON_NULL", + + "name": null, + + "ofType": { + + "kind": "SCALAR", + + "name": "String", + + "description": "A string" + + }, + + "description": null + + }, + + "description": null + + }, + + { + + "name": "party", + + "type": { + + "kind": "NON_NULL", + + "name": null, + + "ofType": { + + "kind": "OBJECT", + + "name": "Party", + + "description": null + + }, + + "description": null + + }, + + "description": null + + } + + ] + + } + + } + } (1 row) @@ -134,9 +211,11 @@ begin; kind fields { name - kind description type { + name + kind + description ofType { name kind @@ -148,15 +227,78 @@ begin; } $$) ); - jsonb_pretty --------------------------------------------------------- - { + - "data": null, + - "errors": [ + - { + - "message": "unknown field in __Field kind"+ - } + - ] + + jsonb_pretty +---------------------------------------------------------------------------------------------- + { + + "data": { + + "__type": { + + "kind": "OBJECT", + + "fields": [ + + { + + "name": "nodeId", + + "type": { + + "kind": "NON_NULL", + + "name": null, + + "ofType": { + + "kind": "SCALAR", + + "name": "ID", + + "description": "A globally unique identifier for a given record"+ + }, + + "description": null + + }, + + "description": "Globally Unique Record Identifier" + + }, + + { + + "name": "id", + + "type": { + + "kind": "NON_NULL", + + "name": null, + + "ofType": { + + "kind": "SCALAR", + + "name": "UUID", + + "description": "A universally unique identifier" + + }, + + "description": null + + }, + + "description": null + + }, + + { + + "name": "givenName", + + "type": { + + "kind": "SCALAR", + + "name": "String", + + "ofType": null, + + "description": "A string" + + }, + + "description": null + + }, + + { + + "name": "familyName", + + "type": { + + "kind": "SCALAR", + + "name": "String", + + "ofType": null, + + "description": "A string" + + }, + + "description": null + + }, + + { + + "name": "party", + + "type": { + + "kind": "NON_NULL", + + "name": null, + + "ofType": { + + "kind": "OBJECT", + + "name": "Party", + + "description": null + + }, + + "description": null + + }, + + "description": null + + } + + ] + + } + + } + } (1 row) diff --git a/test/sql/issue_557_1_to_1_nullability.sql b/test/sql/issue_557_1_to_1_nullability.sql index 997a1dcc..81801853 100644 --- a/test/sql/issue_557_1_to_1_nullability.sql +++ b/test/sql/issue_557_1_to_1_nullability.sql @@ -30,6 +30,9 @@ begin; fields { name type { + name + kind + description ofType { name kind @@ -51,9 +54,11 @@ begin; kind fields { name - kind description type { + name + kind + description ofType { name kind @@ -73,9 +78,11 @@ begin; kind fields { name - kind description type { + name + kind + description ofType { name kind