Hello, anyone know how to fix prisma-example, <htt...
# orm-help
n
Copy code
Type 'Promise<Post[]>' is not assignable to type '{ content?: string; createdAt: any; id: string; published: boolean; title: string; updatedAt: any; }[] | PromiseLike<{ content?: string; createdAt: any; id: string; published: boolean; title: string; updatedAt: any; }[]> | MaybePromise<...>[] | PromiseLike<...>'.
  Type 'Promise<Post[]>' is not assignable to type 'PromiseLike<{ content?: string; createdAt: any; id: string; published: boolean; title: string; updatedAt: any; }[] | MaybePromise<{ content?: string; createdAt: any; id: string; published: boolean; title: string; updatedAt: any; } | { ...; }>[]>'.
    Types of property 'then' are incompatible.
      Type '<TResult1 = Post[], TResult2 = never>(onfulfilled?: (value: Post[]) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<...>' is not assignable to type '<TResult1 = { content?: string; createdAt: any; id: string; published: boolean; title: string; updatedAt: any; }[] | MaybePromise<{ content?: string; createdAt: any; id: string; published: boolean; title: string; updatedAt: any; } | { ...; }>[], TResult2 = never>(onfulfilled?: (value: { ...; }[] | MaybePromise<...>[...'.
        Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible.
          Types of parameters 'value' and 'value' are incompatible.
            Type 'Post[]' is not assignable to type '{ content?: string; createdAt: any; id: string; published: boolean; title: string; updatedAt: any; }[] | MaybePromise<{ content?: string; createdAt: any; id: string; published: boolean; title: string; updatedAt: any; } | { ...; }>[]'.
              Type 'Post[]' is not assignable to type '{ content?: string; createdAt: any; id: string; published: boolean; title: string; updatedAt: any; }[]'.
                Type 'Post' is missing the following properties from type '{ content?: string; createdAt: any; id: string; published: boolean; title: string; updatedAt: any; }': createdAt, updatedAtts(2322)
typegenTypeHelpers.d.ts(68, 88): The expected type comes from the return type of this signature.
error related to
Copy code
t.list.field('posts', {
      type: 'Post',
      resolve: parent =>
        prisma.user
          .findOne({
            where: { id: Number(<http://parent.id|parent.id>) },
          })
          .posts(),
    })
many thanks in advance for the help. Seems
graphql-nextjs
doesn't work well
g
Seeing the same issue. Did you get this resolved?