TIL/GraphQL

GraphQL | Field 'email' is not defined in the input type 'UserWhereUniqueInput'.

홍차23 2020. 2. 1. 00:24

requestSecret -> true

 

error>

{ Error: Variable '$where' expected value of type 'UserWhereUniqueInput!' but got: {"email":"kay@gmail.com"}. Reason: 'email' Field 'email' is not defined in the input type 'UserWhereUniqueInput'. (line 1, column 36):
mutation ($data: UserUpdateInput!, $where: UserWhereUniqueInput!) 

 

solution>

datamodel.prisma > 

userName: String! @unique 

email: String! @unique

 

@unique 를 추가함.