Jscott388
06/19/2019, 2:39 PMScottAgirs
06/19/2019, 2:54 PMconnect
field was missing due to absence of a field with @unique
directive
No connect
field on BuildingCreateManyWithoutCoursesInput
.
I have two identical datatypes (Home
, Apartment
) that relate to another (Building
) and for some reason Prisma generated connect
field for Home
& Apartment
, but not for Building
to Home
.
Any ideas?
type Home {
id: ID! @id
buildings: [Building]
slug: String! @unique
}
type Building {
id: ID! @id
homes: [Home]
apartments: [Apartment]
slug: String! @unique
}
type Apartment {
id: ID! @id
buildings: [Building]
slug: String! @unique
}
Trying to connect Apartment to Building, when creating new ApartmentAdrian Lineweaver
06/19/2019, 5:33 PMSynthseth
06/19/2019, 7:39 PMSynthseth
06/19/2019, 7:42 PMimpowski
06/19/2019, 7:54 PMtslint
gives me this error and I donât know how to fix it, Iâm using a `Prisma2`:
Module '@generated/photon' is not listed as dependency in package.json
Bkc
06/19/2019, 9:28 PMprisma-multi-tenant
. It will do the following
(1) Create a unique database instance by copying datamodel.prisma
(2) Connect the unique database to a shared Prisma/Heroku server
(3) Connect each tenant to the product data/servergem
06/20/2019, 3:44 AMgem
06/20/2019, 3:44 AMgem
06/20/2019, 3:44 AMSynthseth
06/20/2019, 5:34 AMarto
06/20/2019, 5:38 AMArmaan Dhanji
06/20/2019, 6:05 AMwelink
06/20/2019, 9:37 AMTanjim Hossain
06/20/2019, 10:27 AMvnadygin
06/20/2019, 10:47 AMWARNING: SQLException occurred while connecting to <http://db-postgresql-lon1-28856-do-user-3676973-0.db.ondigitalocean.com:25060|db-postgresql-lon1-28856-do-user-3676973-0.db.ondigitalocean.com:25060>
prisma_1 | org.postgresql.util.PSQLException: FATAL: database "postgres" does not exist
environment:
PRISMA_CONFIG: |
port: 4433
# uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
# managementApiSecret: my-secret
databases:
default:
connector: postgres
host: <http://db-postgresql-lon1-28856-do-user-3676973-0.db.ondigitalocean.com|db-postgresql-lon1-28856-do-user-3676973-0.db.ondigitalocean.com>
database: defaultdb
schema: public
user: doadmin
password: password
ssl: true
rawAccess: true
port: 25060
migrations: true
vnadygin
06/20/2019, 10:48 AMdatabase: defaultdb
is not passing to the configgem
06/20/2019, 11:12 AMJovaanc
06/20/2019, 1:20 PMJovaanc
06/20/2019, 1:21 PMJovaanc
06/20/2019, 1:22 PMJovaanc
06/20/2019, 1:23 PMCorey Snyder
06/20/2019, 2:26 PM<https://www.howtographql.com>
? Curious b/c theyâre so tightly integrated and referenced. I donât mind either way. Prisma has been a pleasure to work with.Corey Snyder
06/20/2019, 2:29 PMCorey Snyder
06/20/2019, 3:16 PMtype FlightController{
id: ID! @id
name: String!
releaseDate: DateTime!
uarts: Int!
GyroOne: Float
GyroTwo: Float
weightInGrams: Float
cpu: String!
dimensions: String
holePattern: String!
voltageInputMin: Float!
voltageInputMax: Float!
osd: Boolean!
accelerometer: Boolean!
barometer: Boolean!
spektrumPort: Boolean!
usbInterface: Boolean!
LedWS2812Support: Boolean!
RSSIPad: Boolean!
currentSensor: Boolean!
beeperPad: Boolean!
beeperOnBoard: Boolean!
antiVibrationGrommets: Boolean!
builtInReceiver: String #"CROSSFIRE/DSMX/FRSKY"
postedBy: User
}
schema.graphql Query
type FlightController {
id: ID!
name: String!
releaseDate: String!
uarts: Int!
weightInGrams: Float
cpu: String!
dimensions: String!
holePattern: String!
voltageInputMin: Float!
voltageInputMax: Float!
osd: Boolean!
accelerometer: Boolean!
barometer: Boolean!
spektrumPort: Boolean!
usbInterface: Boolean!
ledOutput: Boolean!
builtInReceiver: ReceiverProtocol
}
and then again in your mutation
type Mutation {
addFlightController(
# ... all the things here again
) : FlightController!
}
Corey Snyder
06/20/2019, 3:17 PMtafelito
06/20/2019, 5:37 PMtype User {
id: ID! @id
email: String! @unique
password: String!
name: String
cart: UserCart
}
type CartItem {
id: ID! @id
product: Product!
quantity: Float!
}
type UserCart {
id: ID! @id
user: User! @relation(link: INLINE)
items: [CartItem]
}
how can I query UserCart by user id?tafelito
06/20/2019, 5:40 PMrein
06/20/2019, 5:48 PMMike Stecker
06/20/2019, 7:33 PMtype User {
id: ID! @id
email: String! @unique
password: String!
}
type BlockUser {
id: ID! @id
user: User! @relation(name: "UserBlocking")
blocked: User! @relation(name: "UserBlocked")
dateBlocked: DateTime! @createdAt
}
If one of the two users is deleted, would the entire entry here be deleted? I tried adding , onDelete: CASCADE
to both `@relation`'s but when I delete a user in the Prisma admin (http://localhost:4466/_admin), it goes to a white screen and seems to freak out because a page reload in the browser shows nothing happened when I tried to delete one of these two users.