Swapnil Tandel
10/14/2021, 4:41 AMSwapnil Tandel
10/14/2021, 8:32 PMLars Ivar Igesund
10/18/2021, 8:17 AMFrancesco Longo
10/18/2021, 7:07 PMFrancesco Longo
10/18/2021, 7:07 PMFrancesco Longo
10/18/2021, 7:09 PMFrancesco Longo
10/18/2021, 7:10 PMFrancesco Longo
10/18/2021, 7:10 PMFrancesco Longo
10/18/2021, 7:10 PMLars Ivar Igesund
10/20/2021, 11:18 AMMike B.
10/28/2021, 3:56 PMupdatedAt
field for a particular resource to update when you’re making a change to one of it’s inline relations?
When I run the updateProduct
method, and connect/update the Product’s type
, the Product’s updatedAt
value doesn’t change.
type Product {
id: ID! @id
type: ProductType!
createdAt: DateTime! @createdAt
updatedAt: DateTime @updatedAt
}
type ProductType {
id: ID! @id
createdAt: DateTime! @createdAt
updatedAt: DateTime @updatedAt
}
await prisma.updateProduct({
where: {
id: existingProduct.id,
},
data: {
type: {
connect: {
id: productTypeId,
},
},
},
})
Lars Ivar Igesund
11/01/2021, 12:15 PMLars Ivar Igesund
11/09/2021, 8:52 PMLars Ivar Igesund
11/09/2021, 8:53 PMLars Ivar Igesund
11/09/2021, 8:54 PMLars Ivar Igesund
11/09/2021, 9:43 PMLars Ivar Igesund
11/09/2021, 9:53 PMLars Ivar Igesund
11/10/2021, 10:26 AMMaciek K
11/17/2021, 3:30 PMlawjolla
11/29/2021, 8:20 PMt.field("images", {
list: true,
type: "Image",
resolve: async (parent: any, _, { prisma }) => {
const images: any[] = await prisma
.vehicle({ id: parent.id })
.images({
where: { AND: [{ access: ["Public"] }] },
orderBy: `order_ASC`
})
.$fragment(
`
{ id url order createdAt description access tags { id tag }}
`
)
return images
})})
You need need to be more careful about your data model. e.g. in this case, I'm only exposing a subset of the Tag type so the client needs to know it can't query the whole thing or any relations off of TagMoray Macdonald
12/03/2021, 12:27 PMtype User {
id: ID! @id
link: Link @relation(link: INLINE, name: "LinkToUser")
}
type Link {
id: ID! @id
users: [User!]! @relation(name: "LinkToUser", onDelete: SET_NULL)
}
I'm now trying to add a different relation between these same entities:
type User {
id: ID! @id
link: Link @relation(link: INLINE, name: "LinkToUser")
notificationLinks: [Link!]! @relation(name: "LinkNotificationUsers")
}
type Link {
id: ID! @id
users: [User!]! @relation(name: "LinkToUser", onDelete: SET_NULL)
notifyUsers: [User!]! @relation(name: "LinkNotificationUsers", onDelete: SET_NULL)
}
however when I try to deploy the change, I get the following error:
There is a relation ambiguity during the migration. Please first name the old relation on your schema. The ambiguity is on a relation between Link and User. Please name relations or change the schema in steps.
I'm not sure how to fix this issue as, as far as I can tell, all I'm doing is deploying a named relation in addition to a pre-existing named relation. Any ideas?Mike B.
12/03/2021, 2:31 PMOR: [ ]
), is it possible to “tag” which records were returned from which filter?
Example:
const filteredPosts: Post[] = await prisma.posts({
where: {
OR: [
{
description_contains: 'graphql',
},
{
description_contains: 'prisma',
},
],
},
})
And our results with tags could be:
;[
{
@filteredTag: ["description_contains: 'graphql'"],
id: 'cjsviilj40g8w0b43qntvli9c',
createdAt: '2019-03-05T08:29:35.483Z',
updatedAt: '2019-03-05T08:29:35.483Z',
title: 'GraphQL - The Query Language of the Future',
published: true,
},
{
@filteredTag: ["description_contains: 'prisma'"],
id: 'cjsviiljr0g9j0b43vntjbys1',
createdAt: '2019-03-05T08:29:36.483Z',
updatedAt: '2019-03-05T08:29:36.483Z',
title: 'Prisma replaces traditional ORMs',
published: true,
},
{
@filteredTag: ["description_contains: 'graphql'", "description_contains: 'prisma'"],
id: 'cjsviiljr0g9j0b43vntjbys3',
createdAt: '2019-03-05T08:29:36.483Z',
updatedAt: '2019-03-05T08:29:36.483Z',
title: 'Prisma and GraphQL are great',
published: true,
},
]
Moray Macdonald
12/06/2021, 3:18 PMNino Vrijman
12/13/2021, 8:55 AMlawjolla
12/15/2021, 6:23 PMAli
01/04/2022, 3:21 PM"Task slick.basic.BasicBackend$DatabaseDef$$anon$3@42a247f4 rejected from slick.util.AsyncExecutor$$anon$1$$anon$2@53b4c770[Running, pool size = 1, active threads = 0, queued tasks = 1000, completed tasks = 593312]"
Does someone knows what is the problem and can help me to fix the issue ?Mike B.
01/05/2022, 12:43 PMPost
and Category
via intermediary table named PostCategory
, which we’ve renamed for this example:
type Post {
id: ID! @id
name: String
categories: [PostCategory] @relation(name: "PostToPostCategory")
aliasesOf: [PostCategory] @relation(name: "PostToPostAlias")
...
}
type Category {
id: ID! @id
name: String!
posts: [PostCategory!] @relation(name: "CategoryToPostCategory")
...
}
type PostCategory {
id: ID! @id
post: Post @relation(name: "PostToPostCategory", link: INLINE)
category: Category @relation(name: "CategoryToPostCategory", link: INLINE)
aliasOf: Post @relation(name: "PostToPostAlias", link: INLINE)
}
As soon as we add the aliasesOf
relation, which is an additional relation that links a Post
to another Post
of the same Category
, we are getting the following error on deploy:
There is a relation ambiguity during the migration. Please first name the old relation on your schema. The ambiguity is on a relation between Post and PostCategory. Please name relations or change the schema in steps.
It throws this error when we deploy to our existing instance. However, it works fine when we create the Prisma instance from scratch, but, when we add data to that new instance, it throws the same error.
We’ve read some other posts that mention this error but none of the examples people were posting mentioned 2 relationship fields in the same intermediary table.
Does anyone know what we might be doing wrong?lawjolla
01/05/2022, 6:26 PMLars Ivar Igesund
01/05/2022, 6:47 PMlawjolla
01/05/2022, 6:49 PM