diff --git a/src/graphql.rs b/src/graphql.rs index e1594f8a..1d07eeb1 100644 --- a/src/graphql.rs +++ b/src/graphql.rs @@ -1234,7 +1234,9 @@ impl ___Type for QueryType { let collection_entrypoint = __Field { name_: format!("{}Collection", lowercase_first_letter(table_base_type_name)), - type_: __Type::Connection(connection_type), + type_: __Type::NonNull(NonNullType { + type_: Box::new(__Type::Connection(connection_type)), + }), args: connection_args, description: Some(format!( "A pagable collection of type `{}`", diff --git a/test/expected/function_calls.out b/test/expected/function_calls.out index c31fa2d5..bd2dd34d 100644 --- a/test/expected/function_calls.out +++ b/test/expected/function_calls.out @@ -2021,6 +2021,11 @@ begin; description type { kind + name + ofType { + kind + name + } } args { name @@ -2108,7 +2113,12 @@ begin; ], + "name": "accountCollection", + "type": { + - "kind": "OBJECT" + + "kind": "NON_NULL", + + "name": null, + + "ofType": { + + "kind": "OBJECT", + + "name": "AccountConnection" + + } + }, + "description": "A pagable collection of type `Account`"+ }, + @@ -2128,7 +2138,9 @@ begin; ], + "name": "node", + "type": { + - "kind": "INTERFACE" + + "kind": "INTERFACE", + + "name": "Node", + + "ofType": null + }, + "description": "Retrieve a record by its `ID`" + }, + @@ -2137,7 +2149,9 @@ begin; ], + "name": "returnsAccount", + "type": { + - "kind": "OBJECT" + + "kind": "OBJECT", + + "name": "Account", + + "ofType": null + }, + "description": null + }, + @@ -2157,7 +2171,9 @@ begin; ], + "name": "returnsAccountWithId", + "type": { + - "kind": "OBJECT" + + "kind": "OBJECT", + + "name": "Account", + + "ofType": null + }, + "description": null + }, + @@ -2236,7 +2252,9 @@ begin; ], + "name": "returnsSetofAccount", + "type": { + - "kind": "OBJECT" + + "kind": "OBJECT", + + "name": "AccountConnection", + + "ofType": null + }, + "description": null + } + diff --git a/test/expected/function_calls_unsupported.out b/test/expected/function_calls_unsupported.out index 3b1a1e9e..97c79334 100644 --- a/test/expected/function_calls_unsupported.out +++ b/test/expected/function_calls_unsupported.out @@ -292,6 +292,11 @@ begin; description type { kind + name + ofType { + kind + name + } } args { name @@ -357,7 +362,12 @@ begin; ], + "name": "accountCollection", + "type": { + - "kind": "OBJECT" + + "kind": "NON_NULL", + + "name": null, + + "ofType": { + + "kind": "OBJECT", + + "name": "AccountConnection" + + } + }, + "description": "A pagable collection of type `Account`"+ }, + @@ -372,7 +382,9 @@ begin; ], + "name": "node", + "type": { + - "kind": "INTERFACE" + + "kind": "INTERFACE", + + "name": "Node", + + "ofType": null + }, + "description": "Retrieve a record by its `ID`" + } + diff --git a/test/expected/resolve_graphiql_schema.out b/test/expected/resolve_graphiql_schema.out index 454f9465..cac1414c 100644 --- a/test/expected/resolve_graphiql_schema.out +++ b/test/expected/resolve_graphiql_schema.out @@ -5828,9 +5828,13 @@ begin; ], + "name": "accountCollection", + "type": { + - "kind": "OBJECT", + - "name": "AccountConnection", + - "ofType": null + + "kind": "NON_NULL", + + "name": null, + + "ofType": { + + "kind": "OBJECT", + + "name": "AccountConnection", + + "ofType": null + + } + }, + "description": "A pagable collection of type `Account`", + "isDeprecated": false, + @@ -5919,9 +5923,13 @@ begin; ], + "name": "blogCollection", + "type": { + - "kind": "OBJECT", + - "name": "BlogConnection", + - "ofType": null + + "kind": "NON_NULL", + + "name": null, + + "ofType": { + + "kind": "OBJECT", + + "name": "BlogConnection", + + "ofType": null + + } + }, + "description": "A pagable collection of type `Blog`", + "isDeprecated": false, + @@ -6010,9 +6018,13 @@ begin; ], + "name": "blogPostCollection", + "type": { + - "kind": "OBJECT", + - "name": "BlogPostConnection", + - "ofType": null + + "kind": "NON_NULL", + + "name": null, + + "ofType": { + + "kind": "OBJECT", + + "name": "BlogPostConnection", + + "ofType": null + + } + }, + "description": "A pagable collection of type `BlogPost`", + "isDeprecated": false, + @@ -6128,9 +6140,13 @@ begin; ], + "name": "personCollection", + "type": { + - "kind": "OBJECT", + - "name": "PersonConnection", + - "ofType": null + + "kind": "NON_NULL", + + "name": null, + + "ofType": { + + "kind": "OBJECT", + + "name": "PersonConnection", + + "ofType": null + + } + }, + "description": "A pagable collection of type `Person`", + "isDeprecated": false, + diff --git a/test/sql/function_calls.sql b/test/sql/function_calls.sql index d597211e..df3e8ac8 100644 --- a/test/sql/function_calls.sql +++ b/test/sql/function_calls.sql @@ -620,6 +620,11 @@ begin; description type { kind + name + ofType { + kind + name + } } args { name diff --git a/test/sql/function_calls_unsupported.sql b/test/sql/function_calls_unsupported.sql index b6cb3f32..440b90aa 100644 --- a/test/sql/function_calls_unsupported.sql +++ b/test/sql/function_calls_unsupported.sql @@ -179,6 +179,11 @@ begin; description type { kind + name + ofType { + kind + name + } } args { name