Skip to content

Commit

Permalink
fix crdb tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Weakky committed Nov 30, 2023
1 parent 8180e75 commit c055390
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ mod multi_schema {
insta::assert_snapshot!(
run_query!(&runner, r#"
query {
findManyCategoriesOnPosts(where: {postId: {gt: 0}}) {
findManyCategoriesOnPosts(orderBy: [{ postId: asc }, { categoryId: asc }], where: {postId: {gt: 0}}) {
category {
name
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ mod paging_one2m_stable_order {
// Makes: [1 => 2, 2 => 3, 3 => 5]
insta::assert_snapshot!(
run_query!(&runner, r#"query {
findManyTestModel {
findManyTestModel(orderBy: { id: asc }) {
id
related(take: 1, orderBy: [{ fieldA: desc }, {fieldB: asc }, { fieldC: asc }, { fieldD: desc }]) {
id
Expand All @@ -73,7 +73,7 @@ mod paging_one2m_stable_order {
// Makes: [1 => 1, 2 => 4, 3 => 6]
insta::assert_snapshot!(
run_query!(&runner, r#"query {
findManyTestModel {
findManyTestModel(orderBy: { id: asc}) {
id
related(take: -1, orderBy: [{ fieldA: desc }, { fieldB: asc }, { fieldC: asc }, { fieldD: desc }]) {
id
Expand Down Expand Up @@ -185,7 +185,7 @@ mod paging_one2m_unstable_order {
run_query!(
&runner,
r#"query {
findManyTestModel {
findManyTestModel(orderBy: { id: asc }) {
id
related(take: 1, orderBy: [{ fieldA: desc }, {fieldB: asc }, { fieldC: asc }, { fieldD: desc }]) {
id
Expand Down Expand Up @@ -214,7 +214,7 @@ mod paging_one2m_unstable_order {
run_query!(
&runner,
r#"query {
findManyTestModel {
findManyTestModel(orderBy: { id: asc }) {
id
related(take: -1, orderBy: [{ fieldA: desc }, { fieldB: asc }, { fieldC: asc }, { fieldD: desc }]) {
id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ mod order_by_aggr {
run_query!(&runner, r#"{
findManyPost(orderBy: { categories: { _count: asc } }) {
title
categories {
categories(orderBy: { name: asc }) {
name
}
}
}"#),
@r###"{"data":{"findManyPost":[{"title":"bob_post_1","categories":[{"name":"Finance"}]},{"title":"alice_post_1","categories":[{"name":"News"},{"name":"Society"}]},{"title":"bob_post_2","categories":[{"name":"History"},{"name":"Gaming"},{"name":"Hacking"}]}]}}"###
@r###"{"data":{"findManyPost":[{"title":"bob_post_1","categories":[{"name":"Finance"}]},{"title":"alice_post_1","categories":[{"name":"News"},{"name":"Society"}]},{"title":"bob_post_2","categories":[{"name":"Gaming"},{"name":"Hacking"},{"name":"History"}]}]}}"###
);

Ok(())
Expand All @@ -98,12 +98,12 @@ mod order_by_aggr {
run_query!(&runner, r#"{
findManyPost(orderBy: { categories: { _count: desc } }) {
title
categories {
categories(orderBy: { name :asc }) {
name
}
}
}"#),
@r###"{"data":{"findManyPost":[{"title":"bob_post_2","categories":[{"name":"History"},{"name":"Gaming"},{"name":"Hacking"}]},{"title":"alice_post_1","categories":[{"name":"News"},{"name":"Society"}]},{"title":"bob_post_1","categories":[{"name":"Finance"}]}]}}"###
@r###"{"data":{"findManyPost":[{"title":"bob_post_2","categories":[{"name":"Gaming"},{"name":"Hacking"},{"name":"History"}]},{"title":"alice_post_1","categories":[{"name":"News"},{"name":"Society"}]},{"title":"bob_post_1","categories":[{"name":"Finance"}]}]}}"###
);

Ok(())
Expand Down Expand Up @@ -159,12 +159,12 @@ mod order_by_aggr {
run_query!(&runner, r#"{
findManyPost(orderBy: [{ categories: { _count: asc } }, { title: asc }]) {
title
categories {
categories(orderBy: { name: asc }) {
name
}
}
}"#),
@r###"{"data":{"findManyPost":[{"title":"bob_post_1","categories":[{"name":"Finance"}]},{"title":"alice_post_1","categories":[{"name":"News"},{"name":"Society"}]},{"title":"bob_post_2","categories":[{"name":"History"},{"name":"Gaming"},{"name":"Hacking"}]}]}}"###
@r###"{"data":{"findManyPost":[{"title":"bob_post_1","categories":[{"name":"Finance"}]},{"title":"alice_post_1","categories":[{"name":"News"},{"name":"Society"}]},{"title":"bob_post_2","categories":[{"name":"Gaming"},{"name":"Hacking"},{"name":"History"}]}]}}"###
);

Ok(())
Expand All @@ -181,12 +181,12 @@ mod order_by_aggr {
user {
name
}
categories {
categories(orderBy: { name: asc }) {
name
}
}
}"#),
@r###"{"data":{"findManyPost":[{"user":{"name":"Alice"},"categories":[{"name":"News"},{"name":"Society"}]},{"user":{"name":"Bob"},"categories":[{"name":"History"},{"name":"Gaming"},{"name":"Hacking"}]},{"user":{"name":"Bob"},"categories":[{"name":"Finance"}]}]}}"###
@r###"{"data":{"findManyPost":[{"user":{"name":"Alice"},"categories":[{"name":"News"},{"name":"Society"}]},{"user":{"name":"Bob"},"categories":[{"name":"Gaming"},{"name":"Hacking"},{"name":"History"}]},{"user":{"name":"Bob"},"categories":[{"name":"Finance"}]}]}}"###
);

Ok(())
Expand Down Expand Up @@ -571,7 +571,7 @@ mod order_by_aggr {
findManyPost(orderBy: [{ categories: { _count: asc } }, { title: asc }], cursor: { id: 2 }, take: 2) {
id
title
categories {
categories(orderBy: { name: asc }) {
name
}
}
Expand Down

0 comments on commit c055390

Please sign in to comment.