@@ -807,7 +807,7 @@ begin;
807807 rollback to savepoint a;
808808
809809 create table account (
810- id int ,
810+ id int primary key ,
811811 email varchar (255 ),
812812 name text null
813813 );
@@ -820,21 +820,15 @@ begin;
820820 returns account language sql stable
821821 as $$ select id, email, name from account where id = 2 ; $$;
822822
823- create function returns_all_columns_null_account ()
824- returns account language sql stable
825- as $$ select id, email, name from account where id is null ; $$;
826-
827823 create function returns_null_account ()
828824 returns account language sql stable
829825 as $$ select id, email, name from account where id = 9 ; $$;
830826
831827 insert into account(id, email, name)
832828 values
833829 (1 , ' aardvark@x.com' , ' aardvark' ),-- all columns non-null
834- (2 , ' bat@x.com' , null ),-- mixed: some null, some non-null
835- (null , null , null );-- all columns null
830+ (2 , ' bat@x.com' , null );-- mixed: some null, some non-null
836831
837- -- comment on table account is e'@graphql({"totalCount": {"enabled": true}})';
838832
839833 select jsonb_pretty(graphql .resolve ($$
840834 query {
@@ -858,21 +852,7 @@ begin;
858852 }
859853 $$));
860854
861- -- With current implementation we can't distinguish between
862- -- when all columns of a composite type are null and when
863- -- the composite type itself is null. In both these cases
864- -- the result will be null for the top-level field.
865- select jsonb_pretty(graphql .resolve ($$
866- query {
867- returnsAllColumnsNullAccount {
868- id
869- email
870- name
871- __typename
872- }
873- }
874- $$));
875-
855+ -- When no record is found, the top level field becomes null
876856 select jsonb_pretty(graphql .resolve ($$
877857 query {
878858 returnsNullAccount {
0 commit comments