/
prisma_13089.rs
44 lines (37 loc) 路 1.47 KB
/
prisma_13089.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use query_engine_tests::*;
#[test_suite(schema(schema))]
mod prisma_13097 {
fn schema() -> String {
r#"
model TestModel {
id Int @id @map("_id")
text String
}
"#
.to_owned()
}
#[connector_test]
async fn filtering_with_dollar_values(runner: Runner) -> TestResult<()> {
insta::assert_snapshot!(
run_query!(&runner, "mutation { createOneTestModel (data: {id: 1, text: \"foo\"}) { id, text }}"),
@r###"{"data":{"createOneTestModel":{"id":1,"text":"foo"}}}"###
);
insta::assert_snapshot!(
run_query!(&runner, "mutation { createOneTestModel (data: {id: 2, text: \"$foo\"}) { id, text }}"),
@r###"{"data":{"createOneTestModel":{"id":2,"text":"$foo"}}}"###
);
insta::assert_snapshot!(
run_query!(&runner, "query { findFirstTestModel (where: {text: \"foo\"}) { id, text }}"),
@r###"{"data":{"findFirstTestModel":{"id":1,"text":"foo"}}}"###
);
insta::assert_snapshot!(
run_query!(&runner, "query { findFirstTestModel (where: {text: \"$foo\"}) { id, text }}"),
@r###"{"data":{"findFirstTestModel":{"id":2,"text":"$foo"}}}"###
);
insta::assert_snapshot!(
run_query!(&runner, "query { findManyTestModel { id, text }}"),
@r###"{"data":{"findManyTestModel":[{"id":1,"text":"foo"},{"id":2,"text":"$foo"}]}}"###
);
Ok(())
}
}