Skip to content

Commit

Permalink
return value of UserInfo is now optional (#389)
Browse files Browse the repository at this point in the history
Co-authored-by: Charlie McVicker <5622360+CharlieMcVicker@users.noreply.github.com>
  • Loading branch information
GracefulLemming and CharlieMcVicker authored Jan 23, 2024
1 parent 6253baf commit cd224a4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ type Query {
"""
Basic information about the currently authenticated user, if any.
"""
userInfo: UserInfo!
userInfo: UserInfo
}

"""
Expand Down
4 changes: 2 additions & 2 deletions graphql/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ impl Query {

/// Basic information about the currently authenticated user, if any.
#[graphql(guard = "AuthGuard")]
async fn user_info<'a>(&self, context: &'a Context<'_>) -> &'a UserInfo {
context.data_unchecked()
async fn user_info<'a>(&self, context: &'a Context<'_>) -> Option<&'a UserInfo> {
context.data_opt()
}
}

Expand Down
2 changes: 1 addition & 1 deletion website/src/graphql/dailp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ export type Query = {
*/
readonly syllabarySearch: ReadonlyArray<AnnotatedForm>
/** Basic information about the currently authenticated user, if any. */
readonly userInfo: UserInfo
readonly userInfo: Maybe<UserInfo>
/** Get a single word given the word ID */
readonly wordById: AnnotatedForm
/**
Expand Down

0 comments on commit cd224a4

Please sign in to comment.