Sam Jackson
05/23/2018, 1:37 PMAdding Authentication
tutorial (https://www.howtographql.com/graphql-js/6-authentication/) but I am getting this error:
Error: Directive `unique`: Couldn't find type `unique` in any of the schemas.
Has anyone seen this before?nilan
05/23/2018, 1:38 PM@unique
directive from your datamodel somehow ended up in your schema, which should never be the casenilan
05/23/2018, 1:40 PMnilan
05/23/2018, 1:41 PM@unique
in your project 🙂Sam Jackson
05/23/2018, 1:42 PM@unique
on there. Thanks 🙂nilan
05/23/2018, 1:43 PMtype User {
id: ID! @unique
name: String!
email: String! @unique
password: String!
links: [Link!]!
}
nilan
05/23/2018, 1:43 PMtype User {
id: ID!
name: String!
email: String!
links: [Link!]!
}
nilan
05/23/2018, 1:43 PMpassword
is left out deliberatelynilan
05/23/2018, 1:44 PMpassword
field when querying the User
type anywhere in your resolver treeSam Jackson
05/23/2018, 1:44 PMnilan
05/23/2018, 1:45 PMnilan
05/23/2018, 1:45 PM@unique
is a directive that is specific to Prisma datamodels. It tells the Prisma connector to add a unique index to the respective column.Sam Jackson
05/23/2018, 1:45 PMSam Jackson
05/23/2018, 1:46 PM@default
and @relation
?nilan
05/23/2018, 1:46 PMSam Jackson
05/23/2018, 1:46 PMSam Jackson
05/23/2018, 1:46 PMnilan
05/23/2018, 1:46 PMnilan
05/23/2018, 1:46 PM