Skip to content

Commit fecdefe

Browse files
author
Tim Kendrick
committed
fix: Ensure non-null collection schema type
1 parent 9cf4882 commit fecdefe

File tree

4 files changed

+33
-15
lines changed

4 files changed

+33
-15
lines changed

src/graphql.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,9 @@ impl ___Type for QueryType {
12341234

12351235
let collection_entrypoint = __Field {
12361236
name_: format!("{}Collection", lowercase_first_letter(table_base_type_name)),
1237-
type_: __Type::Connection(connection_type),
1237+
type_: __Type::NonNull(NonNullType {
1238+
type_: Box::new(__Type::Connection(connection_type)),
1239+
}),
12381240
args: connection_args,
12391241
description: Some(format!(
12401242
"A pagable collection of type `{}`",

test/expected/function_calls.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2108,7 +2108,7 @@ begin;
21082108
], +
21092109
"name": "accountCollection", +
21102110
"type": { +
2111-
"kind": "OBJECT" +
2111+
"kind": "NON_NULL" +
21122112
}, +
21132113
"description": "A pagable collection of type `Account`"+
21142114
}, +

test/expected/function_calls_unsupported.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ begin;
357357
], +
358358
"name": "accountCollection", +
359359
"type": { +
360-
"kind": "OBJECT" +
360+
"kind": "NON_NULL" +
361361
}, +
362362
"description": "A pagable collection of type `Account`"+
363363
}, +

0 commit comments

Comments
 (0)