schema: make user fields non-nullable
They can always be empty. This simplifies mutation, since graphql_client doesn't have an easy way to conditionally leave out fields (we could do that with `@include`, but that's one bool per field in addition to the field, a bit ugly).
This commit is contained in:
committed by
nitnelave
parent
564c09d6ab
commit
0ac9e134de
@@ -91,9 +91,9 @@ impl Component for UserDetails {
|
||||
<div>
|
||||
<div>{"User ID: "} {&u.id}</div>
|
||||
<div>{"Email: "}{&u.email}</div>
|
||||
<div>{"Display name: "}{&u.display_name.as_ref().unwrap_or(&String::new())}</div>
|
||||
<div>{"First name: "}{&u.first_name.as_ref().unwrap_or(&String::new())}</div>
|
||||
<div>{"Last name: "}{&u.last_name.as_ref().unwrap_or(&String::new())}</div>
|
||||
<div>{"Display name: "}{&u.display_name}</div>
|
||||
<div>{"First name: "}{&u.first_name}</div>
|
||||
<div>{"Last name: "}{&u.last_name}</div>
|
||||
<div>{"Creation date: "}{&u.creation_date.with_timezone(&chrono::Local)}</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -82,9 +82,9 @@ impl Component for UserTable {
|
||||
<tr>
|
||||
<td>{&user.id}</td>
|
||||
<td>{&user.email}</td>
|
||||
<td>{&user.display_name.as_ref().unwrap_or(&String::new())}</td>
|
||||
<td>{&user.first_name.as_ref().unwrap_or(&String::new())}</td>
|
||||
<td>{&user.last_name.as_ref().unwrap_or(&String::new())}</td>
|
||||
<td>{&user.display_name}</td>
|
||||
<td>{&user.first_name}</td>
|
||||
<td>{&user.last_name}</td>
|
||||
<td>{&user.creation_date.with_timezone(&chrono::Local)}</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user