Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return value of UserInfo is now optional #389

Merged
merged 2 commits into from
Jan 23, 2024
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 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