Oscar
05/06/2020, 6:38 PMNicholas Eli
05/06/2020, 9:08 PMNicholas Eli
05/06/2020, 9:12 PMgetPosts(_parent_, _args_, _ctx_, _info_){
return ctx.db.query.posts({}, info)
}
Data Model
type Post {
id: ID! @id
isPublished: Boolean! @default(_value_: false)
title: String!
text: String!
connections: [Connection!]! @relation(_name_: "ClientConnect")
}
type Link {
id: ID! @id
text: String!
url: String!
}
type Connection {
id: ID! @unique @id
client: Link @relation(_name_: "LinkConnect")
}
Schema
type Query {
getLinks(_filter_: String, _skip_: Int, _first_: Int, _orderBy_: LinkOrderByInput): [Link!]!
}
When I try to query this in the playground, on the Connection
object, it references sort for that object. How can I refer it to the Link
so that I may order on text or urlYasir Hussain
05/06/2020, 9:54 PMAnyone please help me.
BRob
05/06/2020, 11:02 PMduplicate key value violates unique constraint
on upsert calls?
Attempting to figure out a good repro case so I can create an issue but it seems sporadic and I can't quite tell how it is happening.Amir Braham
05/06/2020, 11:23 PMRaluca Fleseriu
05/07/2020, 12:46 PMQuentin Nicolle
05/07/2020, 1:48 PMSamrith Shankar
05/07/2020, 2:01 PMQuentin Nicolle
05/07/2020, 2:03 PMSamrith Shankar
05/07/2020, 2:04 PMQuentin Nicolle
05/07/2020, 2:05 PMOmobolanle Aro
05/07/2020, 3:15 PMtype Comment @db(name: "comments"){
id: ID! @id
text: String!
comic: Comic!
likes: Likes!
replies: [Reply!]!
createdAt: DateTime! @createdAt
updatedAt: DateTime! @updatedAt
}
type Likes @embedded {
count: Int! @default(value: 0)
voted: [User!]!
}
I'm trying to update the voted array in the likes type when I update Comments but I haven't been able to do that successfully, Any help will be strongly appreciated.Omobolanle Aro
05/07/2020, 3:25 PMmutation{
updateComment(where: {
id: "5eb411d263445900078ced23"
}
data: {
likes: {
update: {
count: 1,
voted: {
connect: [
{
id: "5eb4104b63445900078ced12"
},
]
}
}
}
}
){
id
likes{
count
voted{
lastName
firstName
}
}
}
}
Javanie Campbell
05/07/2020, 6:42 PMJavanie Campbell
05/07/2020, 7:05 PMMelvin Pacheco
05/07/2020, 10:12 PMmjyoung
05/07/2020, 11:15 PMmodel User {
id String @default("user_" + cuid()) @id
}
Suhail
05/08/2020, 7:31 AMprisma 1.34
and hitting a weird situation. It almost takes 35 seconds for the query to get completed when it fetches me the results under 1 second when using Robo3T or any other GUI client for Mongo. What could be the reason for this? I am already querying on the index. Any suggestions? I have also posted on StackOverflow : https://stackoverflow.com/questions/61674149/takes-35-seconds-to-query-a-mongo-collection-when-using-prisma-inspite-of-queryikitze
05/08/2020, 2:27 PMRodrigo Perez
05/08/2020, 3:20 PMSlackbot
05/09/2020, 12:46 PMGabriel Colson
05/09/2020, 2:05 PMScott
05/09/2020, 3:39 PMTEMILOLUWA OJO PHILIP
05/10/2020, 12:57 PMRyan
05/11/2020, 3:34 PMPubSub
module of apollo-server
with Prisma 2 here.
I have used shield as an auth mechanism as well.Jan
05/11/2020, 5:14 PMHanyati
05/11/2020, 6:29 PMEthan Pursley
05/11/2020, 7:02 PMLars-Jørgen Kristiansen
05/11/2020, 8:22 PMmodel User {
id Int @default(autoincrement()) @id
email String @unique
name String?
posts Post[]
}
model Post {
id Int @default(autoincrement()) @id
authorId Int?
content String?
published Boolean @default(false)
title String
author User? @relation(fields: [authorId], references: [id])
}
If i run this query:
query {
filterPosts{
id
title
author {
name
}
}
}
Why does prisma run 3 SQL queries?
SELECT "public"."Post"."id", "public"."Post"."authorId", "public"."Post"."content", "public"."Post"."published", "public"."Post"."title" FROM "public"."Post" WHERE 1=1 OFFSET 0;
SELECT "public"."Post"."id", "public"."Post"."authorId" FROM "public"."Post" WHERE "public"."Post"."id" IN (1,2,3,4,5,6) OFFSET 0;
SELECT "public"."User"."id", "public"."User"."email", "public"."User"."name" FROM "public"."User" WHERE "public"."User"."id" IN (1, 2) OFFSET 0
The second query seems unnecessary?