Here when i make query

here i have selected them and give me error

if i delete where and orderBy issue is gone

my version 2.0.0-preview024 it's from it because i just back to 2.0.0-preview023 and problem solved
Same problem here, tested it also with https://github.com/prisma/prisma-examples/tree/prisma2/typescript/graphql
When modifying schema.ts:
t.list.field('feed', {
type: 'Post',
resolve: async (_parent, _args, ctx) => {
const posts = await ctx.prisma.post.findMany({
where: { published: true },
include: {
author: {
include: {
posts: { orderBy: { title: 'asc' }, include: { author: true } },
},
},
},
})
const test = posts[0].author?.posts[0].author
return posts
},
})
then the type of posts is
const posts: (Post & {
author: (User & {
posts: Post[];
}) | null;
})[]
when removing orderBy it is correctly
const posts: (Post & {
author: (User & {
posts: (Post & {
author: User | null;
})[];
}) | null;
})[]
Hi @AhmedElywa
Can you please give a minimal reproduction of this? Otherwise please share your datamodel and the client queries. It is quite time consuming to reproduce with screenshots as you can't copy code.
For what it’s worth, I had the same problem when in my schema.prisma file I had a Version model which clashed with some internal type also named “Version” but I couldn’t see the error in the console when compiling TypeScript because I had skipLibCheck set to true.
The lib error I got after disabling skipLibCheck was
node_modules/.pnpm/registry.npmjs.org/@prisma/client/[email protected]/node_modules/@prisma/client/index.d.ts:134:21 - error TS2300: Duplicate identifier 'Version'.
134 export declare type Version = {
~~~~~~~
node_modules/.pnpm/registry.npmjs.org/@prisma/client/[email protected]/node_modules/@prisma/client/index.d.ts:1589:13 - error TS2300: Duplicate identifier 'Version'.
1589 export type Version = {
~~~~~~~
Fixed in last beta
Most helpful comment
Hi @AhmedElywa
Can you please give a minimal reproduction of this? Otherwise please share your datamodel and the client queries. It is quite time consuming to reproduce with screenshots as you can't copy code.