Change all field names to camelCase in GraphQL

This commit is contained in:
Elias Schriefer 2021-10-17 17:09:06 +00:00
parent 8d67300d5f
commit 15e9c596c2

View File

@ -373,7 +373,7 @@ impl Query {
#[graphql_object(context = Context)] #[graphql_object(context = Context)]
impl Query { impl Query {
async fn get_user_id(context: &Context, username: String) -> FieldResult<ID> { async fn getUserID(context: &Context, username: String) -> FieldResult<ID> {
sqlx::query(format!( sqlx::query(format!(
r#"SELECT id FROM users WHERE user_name="{}""#, r#"SELECT id FROM users WHERE user_name="{}""#,
username username
@ -387,7 +387,7 @@ impl Query {
Self::users_sqlx_result(context).await.map_err(FieldError::from) Self::users_sqlx_result(context).await.map_err(FieldError::from)
} }
async fn user_preferences(context: &Context, id: ID) -> FieldResult<UserPreferences> { async fn userPreferences(context: &Context, id: ID) -> FieldResult<UserPreferences> {
UserPreferences::try_get(&id, &context.db).await.map_err(FieldError::from) UserPreferences::try_get(&id, &context.db).await.map_err(FieldError::from)
} }
} }