Skip to content

Commit

Permalink
Change model query field to camel case
Browse files Browse the repository at this point in the history
  • Loading branch information
JunichiSugiura committed Jan 9, 2024
1 parent c78fad8 commit 674a95a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/torii/graphql/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use anyhow::Result;
use async_graphql::dynamic::{
Field, Object, Scalar, Schema, Subscription, SubscriptionField, Union,
};
use convert_case::{Case, Casing};
use sqlx::SqlitePool;
use torii_core::types::Model;

Expand Down Expand Up @@ -126,7 +127,7 @@ async fn build_objects(pool: &SqlitePool) -> Result<(Vec<Box<dyn ObjectTrait>>,
let type_mapping = type_mapping_query(&mut conn, &model.id).await?;

if !type_mapping.is_empty() {
let field_name = model.name.to_lowercase();
let field_name = model.name.to_case(Case::Camel);
let type_name = model.name;

union = union.possible_type(&type_name);
Expand Down

0 comments on commit 674a95a

Please sign in to comment.