Ashiqur Rahman
07/20/2020, 2:31 PMconst categories = [
{ name: 'search engine' },
{ name: 'language translation' },
{ name: 'home life' },
{ name: 'read' },
{ name: 'telecommutin' },
{ name: 'tool' },
{ name: 'learn' },
{ name: 'make money' },
];
const createManyCategories = categories.map((category) =>
prisma.category.create({
data: category,
})
);
I have created some categories like this,
I saw on prisma studio they are save as id 1,2,3....8
but when I want to query them from playground, I dont get any id.
How can I get it?Ryan
07/20/2020, 2:59 PMid to the query and run it?Ashiqur Rahman
07/20/2020, 3:00 PMquery Categories {
categories {
id
name
}
}Ashiqur Rahman
07/20/2020, 3:01 PM{
"error": {
"errors": [
{
"message": "Cannot query field \"id\" on type \"Category\".",
"locations": [
{
"line": 3,
"column": 5
}
]
}
]
}
}Ashiqur Rahman
07/20/2020, 3:02 PMRyan
07/20/2020, 3:03 PMid in your schema.graphql?Ashiqur Rahman
07/20/2020, 3:19 PMRyan
07/20/2020, 3:24 PM