gqlify
gqlify copied to clipboard
Possibility to use other field as primary key
Describe the solution you'd like For example:
type User @GQLifyModel(dataSource: "firestore", key: "employees") {
email: String! @unique
name: String!
}
email field as primary key instead of firestore generated id.
Additional context
- Does it affect relationship implementation?
- On the other hand, do we allow composite primary keys?
I have a same problem!!!
@unique dosen't work in the schema this is m schema:
export const Article = `
type Article @GQLifyModel(dataSource: "mongodb", key: "articles")
{ url: ID! @unique
title: String! img:
String content: String post: Boolean
}`;
But, but when I create a new article with the a just existent url, the mutation pass and create a new registry with a same url. the @unique dosen't work?