-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: query graph should extract join results using prisma field name (#…
- Loading branch information
Showing
4 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/prisma_15177.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use indoc::indoc; | ||
use query_engine_tests::*; | ||
|
||
#[test_suite(schema(schema), exclude(MongoDb))] | ||
mod prisma_15177 { | ||
fn schema() -> String { | ||
let schema = indoc! { | ||
r#"model Customer { | ||
#id(userId, Int, @id @map("user id")) | ||
}"# | ||
}; | ||
|
||
schema.to_owned() | ||
} | ||
|
||
// Should allow CRUD methods on a table column that has a space | ||
#[connector_test] | ||
async fn repro(runner: Runner) -> TestResult<()> { | ||
insta::assert_snapshot!( | ||
run_query!(&runner, r#"mutation { createOneCustomer(data: { userId: 1 }) { userId } }"#), | ||
@r###"{"data":{"createOneCustomer":{"userId":1}}}"### | ||
); | ||
|
||
insta::assert_snapshot!( | ||
run_query!(&runner, r#"{ findManyCustomer { userId } }"#), | ||
@r###"{"data":{"findManyCustomer":[{"userId":1}]}}"### | ||
); | ||
|
||
insta::assert_snapshot!( | ||
run_query!(&runner, r#"mutation { updateOneCustomer(where: { userId: 1 }, data: { userId: 2 }) { userId } }"#), | ||
@r###"{"data":{"updateOneCustomer":{"userId":2}}}"### | ||
); | ||
|
||
insta::assert_snapshot!( | ||
run_query!(&runner, r#"mutation { deleteOneCustomer(where: { userId: 2 }) { userId } }"#), | ||
@r###"{"data":{"deleteOneCustomer":{"userId":2}}}"### | ||
); | ||
|
||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters