freshtonic
08/14/2019, 1:06 AMconor
08/14/2019, 2:21 PMtafelito
08/14/2019, 6:23 PMtype Product {
id: ID! @id
....
}
type CartItem {
id: ID! @id
product: Product!
quantity: Float!
cart: Cart!
}
type Cart {
id: ID! @id
user: User! @relation(name: "Cart", link: INLINE)
items: [CartItem] @relation(onDelete: CASCADE)
}
the CRUD operations generated by prisma does not allow to update a CartItem based on a product.id, is there any other way to do this other than manually add productId to the cartItem?
type CartItem {
id: ID! @id
productId: ID! @unique
product: Product!
quantity: Float!
cart: Cart!
}
Basically, I want to update an item of a Cart where instead of doing it by CartItem.id I want to do it by CartItem.product.id or even by Cart.idRyan Rickerts
08/14/2019, 8:16 PMprisma deploy
seems to work, the GraphQL playground works, but when I go to Prisma Admin, I’m getting logs about Scheduling deployment for project default@default
and prisma reset
says: “Are you sure that you want to reset the data of default in stage default?” Where is this default@default getting created? Is it at all related to my docker-compose.yml that specified the Prisma config? Mine is something like the following: network_mode: host
environment:
PRISMA_CONFIG: |
port: 4466
databases:
proteus:
connector: mysql
host: 127.0.0.1
database: nest_prisma1
user: root
password: changedThis
rawAccess: true
port: '3306'
migrations: true
Should it be looking for proteus@nest_prisma1
? Where would I change that configuration? The migration docs for Prisma v1.14 talk about ‘multi-tenancy’ and ‘single-tenant’ https://www.prisma.io/docs/reference/service-configuration/data-model/migrations-ao8viesh2r “Currently it is only possible to configure a single database and it has to be called default. In the future it will be possible to configure multiple named databases and use them from the same service.” but in the 1.34 docs this page does not look the same.Nelson Pecora
08/14/2019, 8:55 PMnexus
, where should I put business logic that I want to run when fetching/saving types? i.e. not just field resolvers, but whole typesAndrew O.
08/14/2019, 11:14 PMSebastian Berg
08/15/2019, 9:23 AMJavid Abdullaev
08/15/2019, 1:32 PMKaran Dwivedi
08/15/2019, 4:19 PMRonnie Gauny
08/15/2019, 5:46 PMJared
08/15/2019, 6:42 PMNelson Pecora
08/15/2019, 6:51 PM@prisma/nexus
and nexus
on npm? also, is nexus-prisma
a thing? (I’m generating @generated/nexus-prisma
)Corey Snyder
08/15/2019, 8:23 PMNeal
08/15/2019, 8:25 PM@relation
and when not, to I can't find any clear reason 😞Neal
08/15/2019, 8:25 PMNeal
08/15/2019, 8:26 PMNeal
08/15/2019, 8:26 PMCorey Snyder
08/15/2019, 8:27 PM@relation
when I have duplicate connections between two types that are for different purposes. Such as:
addedFlightControllers: [FlightController!]! @relation(name: "AddedFlightControllers")
editedFlightControllers: [FlightController!]! @relation(name: "EditedFlightControllers")
Corey Snyder
08/15/2019, 8:27 PMNeal
08/15/2019, 8:35 PMNeal
08/15/2019, 8:35 PMNeal
08/15/2019, 8:35 PMCorey Snyder
08/15/2019, 8:36 PMpostedBy: User @relation(name: "AddedFlightControllers")
<< I define it on the other side tooLQ
08/15/2019, 8:36 PMLQ
08/15/2019, 8:36 PMNeal
08/15/2019, 8:36 PMNeal
08/15/2019, 8:37 PMtype User {
id: ID! @id
}
type Company {
id: ID! @id
createdBy: User
members: [User!]!
}
Neal
08/15/2019, 8:37 PMNeal
08/15/2019, 8:38 PM@relation
on the id of the User
type then?Neal
08/15/2019, 8:38 PMmembers
it automaps