Skip to content

Commit 6c70d55

Browse files
author
Alexei Pastuchov
committed
Display implementation of GraphqlInsertable filters out primary keys
1 parent a008075 commit 6c70d55

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

wundergraph_cli/src/print_schema/print_helper.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,16 @@ impl<'a> Display for GraphqlInsertable<'a> {
475475
{
476476
let mut out = PadAdapter::new(f);
477477
writeln!(out)?;
478-
for c in self.table.column_data.iter().filter(|c| !c.has_default) {
478+
for c in self.table.column_data.iter().filter(|c| {
479+
!c.has_default
480+
&& self
481+
.table
482+
.primary_key
483+
.iter()
484+
.filter(|x| **x == c.sql_name)
485+
.count()
486+
== 0
487+
}) {
479488
let t = GraphqlType {
480489
sql_type: &c.ty,
481490
allow_option: true,

0 commit comments

Comments
 (0)