From 40769a13baa4e8cbf21b24bb48f75da48bfb788a Mon Sep 17 00:00:00 2001 From: Michael Hayes Date: Tue, 22 Oct 2024 17:38:17 -0700 Subject: [PATCH] fix inconsistent test --- .../tests/__snapshots__/index.test.ts.snap | 2 +- .../tests/examples/simple/schema/index.ts | 2 +- .../plugin-prisma-utils/tests/index.test.ts | 21 ++++++++++++------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/packages/plugin-prisma-utils/tests/__snapshots__/index.test.ts.snap b/packages/plugin-prisma-utils/tests/__snapshots__/index.test.ts.snap index cdbf4e6c5..704a24ff9 100644 --- a/packages/plugin-prisma-utils/tests/__snapshots__/index.test.ts.snap +++ b/packages/plugin-prisma-utils/tests/__snapshots__/index.test.ts.snap @@ -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 { diff --git a/packages/plugin-prisma-utils/tests/examples/simple/schema/index.ts b/packages/plugin-prisma-utils/tests/examples/simple/schema/index.ts index 931ecfa47..9dc180a54 100644 --- a/packages/plugin-prisma-utils/tests/examples/simple/schema/index.ts +++ b/packages/plugin-prisma-utils/tests/examples/simple/schema/index.ts @@ -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, diff --git a/packages/plugin-prisma-utils/tests/index.test.ts b/packages/plugin-prisma-utils/tests/index.test.ts index 2070a9ea8..5ae52ee79 100644 --- a/packages/plugin-prisma-utils/tests/index.test.ts +++ b/packages/plugin-prisma-utils/tests/index.test.ts @@ -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 @@ -54,13 +54,13 @@ describe('prisma utils', () => { "author": { "name": "Schuyler Bergnaum", }, - "id": "28", + "id": "27", }, { "author": { "name": "Schuyler Bergnaum", }, - "id": "27", + "id": "28", }, ], }, @@ -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": {