Skip to content

Commit

Permalink
fix inconsistent test
Browse files Browse the repository at this point in the history
  • Loading branch information
hayes committed Oct 23, 2024
1 parent 71a722a commit 40769a1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ input ProfileOrderBy {
type Query {
post(list: StringListFilter, title: StringFilter): Post
posts(filter: PostFilter, order: PostOrderBy): [Post!]
posts(filter: PostFilter, order: [PostOrderBy!]): [Post!]
}
input StringFilter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const PostFilter = builder.prismaWhere('Post', {
builder.queryField('posts', (t) =>
t.prismaField({
type: ['Post'],
args: { filter: t.arg({ type: PostFilter }), order: t.arg({ type: PostOrderBy }) },
args: { filter: t.arg({ type: PostFilter }), order: t.arg({ type: [PostOrderBy] }) },
resolve: (query, _, args) =>
prisma.post.findMany({
...query,
Expand Down
21 changes: 13 additions & 8 deletions packages/plugin-prisma-utils/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('prisma utils', () => {
const query = gql`
query {
posts(
order: { author: { name: Desc, profile: null } }
order: [{ author: { name: Desc, profile: null } }, {id: Asc }]
filter: { id: { not: { equals: 11 } } }
) {
id
Expand Down Expand Up @@ -54,13 +54,13 @@ describe('prisma utils', () => {
"author": {
"name": "Schuyler Bergnaum",
},
"id": "28",
"id": "27",
},
{
"author": {
"name": "Schuyler Bergnaum",
},
"id": "27",
"id": "28",
},
],
},
Expand All @@ -75,12 +75,17 @@ describe('prisma utils', () => {
"include": {
"author": true,
},
"orderBy": {
"author": {
"name": "desc",
"profile": undefined,
"orderBy": [
{
"author": {
"name": "desc",
"profile": undefined,
},
},
},
{
"id": "asc",
},
],
"take": 3,
"where": {
"id": {
Expand Down

0 comments on commit 40769a1

Please sign in to comment.