Hi! new to prisma and trying to understand some ba...
# prisma-client
b
Hi! new to prisma and trying to understand some basics, trying to do something simple (or seems should be simple) but running into some typing crazyness.
Copy code
async update(updatedBy:Principal, data: Prisma.BlogUpdateInput): Promise<BlogEntry> {
        data.updatedBy = updateBy.principalId;
        return await this.prisma.blogEntry.update({
                                where: {
                                    id: data.id
                                },
                                data: data
                            });
    }
but this yields me an syntax error stating:
Copy code
Type 'string | StringFieldUpdateOperationsInput' is not assignable to type 'string'.
  Type 'StringFieldUpdateOperationsInput' is not assignable to type 'string'.ts(2322)
index.d.ts(4311, 5): The expected type comes from property 'id' which is declared here on type 'BlogEntryWhereUniqueInput'
BlogUpdateInput.id is just a string... what "generated" type should I be using to on my
update()
method that wraps the call to prisma? This is a bit confusing
👀 1
h
Can you please share this code in a small Git repos so that we can try it out and suggest something?
v
👋 Hello @bitsofinfo - did you have a chance to see Harshit's message? Please let us know if you can share this code in a small Git repos!