Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ When no exposed schema has opted in, `__schema` and `__type` selections return a
{ "errors": [{ "message": "Unknown field \"__schema\" on type Query" }] }
```

#### Partial introspection accross multiple schemas
#### Partial introspection across multiple schemas

!!!note "disable introspection for all schemas"

Expand Down
10 changes: 7 additions & 3 deletions src/graphql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1314,11 +1314,15 @@ impl ___Type for QueryType {
// Use graphql_column_field_name to convert snake_case to camelCase if needed
let arg_name = self.schema.graphql_column_field_name(col);

// sql_column_to_graphql_type already wraps NOT NULL columns in NonNull.
// For view columns (always nullable in PG), we must add it ourselves.
let non_null_col_type = match col_type {
__Type::NonNull(_) => col_type,
t => __Type::NonNull(NonNullType { type_: Box::new(t) }),
};
pk_args.push(__InputValue {
name_: arg_name,
type_: __Type::NonNull(NonNullType {
type_: Box::new(col_type),
}),
type_: non_null_col_type,
description: Some(format!("The record's `{}` value", col_name)),
default_value: None,
sql_type: Some(NodeSQLType::Column(Arc::clone(col))),
Expand Down
4 changes: 2 additions & 2 deletions test/expected/function_calls.out
Original file line number Diff line number Diff line change
Expand Up @@ -2058,8 +2058,8 @@ begin;
"kind": "NON_NULL", +
"name": null, +
"ofType": { +
"kind": "NON_NULL", +
"name": null +
"kind": "SCALAR", +
"name": "Int" +
} +
} +
} +
Expand Down
Loading