deactivateduser
11/02/2019, 6:22 PMCorey Snyder
11/15/2019, 3:52 PMcontext.prisma.droneBuild({id: buildId})
with all of it’s downstream parts in a single network request, rather than having to make 10 queries to retrieve that information.
const flightController = await context.prisma.droneBuild({id: buildId}).flightController().flightController()
const esc = await context.prisma.droneBuild({id: buildId}).esc().esc()
const vtx = await context.prisma.droneBuild({id: buildId}).vtx().vtx()
const receiver = await context.prisma.droneBuild({id: buildId}).receiver().receiver()
const camera = await context.prisma.droneBuild({id: buildId}).camera().camera()
const motor = await context.prisma.droneBuild({id: buildId}).motor().motor()
const propeller = await context.prisma.droneBuild({id: buildId}).propeller().propeller()
const frame = await context.prisma.droneBuild({id: buildId}).frame().frame()
const antenna = await context.prisma.droneBuild({id: buildId}).antenna().antenna()
const battery = await context.prisma.droneBuild({id: buildId}).battery().battery()
Fransjo Leihitu
12/02/2019, 9:17 PMtype Poi {
id: ID! @id
title: String!
address: PoiAddress
}
type PoiAddress {
id: ID! @id
address1: String
address2: String
zipcode: String
country: String
}
Now I want all Poi's wich don't have an address. I tried
prisma.pois({
where : {
address : {
country: null
}
}
});
But that gave me an empty response. Any ideas?Nelson Pecora
12/13/2019, 2:40 PMtype Content {
name: String
children: [Content!]! @relation(link: TABLE, name: "ContentChildren")
}
Then I do a query to my GraphQL API with more than two levels of nesting, e.g.:
{
content(id: $id) {
children {
name
children {
name
children {
name
children {
name
}
}
}
}
}
}
And in my children
resolver, I call prisma.content({ id }).children()
, I see response times that look like this:
• first level: ~30ms
• second level: ~30ms
• third level: ~200ms
• fourth level: ~700msNelson Pecora
12/13/2019, 2:46 PMprisma
behind a dataloader, and I've tried memoizing individual calls, but both approaches seem to just be papering over the underlying problemNelson Pecora
12/13/2019, 2:55 PMNelson Pecora
12/13/2019, 2:57 PMprisma.thing({ id }).relationToOtherThing()
should take the same amount of time no matter where that thing
is in the original query, no?Nelson Pecora
12/13/2019, 4:08 PMNelson Pecora
12/17/2019, 3:44 PMNelson Pecora
12/17/2019, 3:44 PMNelson Pecora
12/17/2019, 3:45 PMNelson Pecora
12/17/2019, 3:46 PM{ tags { assignedTo { id } } }
that generates these prisma calls in my resolvers:
• prisma.contents({ id }).tags()
• prisma.tags({ id }).assignedTo()
Nelson Pecora
12/17/2019, 3:47 PMAlbert
01/03/2020, 9:45 AMHi, I'm working with prisma1 and wondering how one would do something similar to a SQLWith a [response](https://prisma.slack.com/archives/CKQTGR6T0/p1578044014242700?thread_ts=1578043823.242500&cid=CKQTGR6T0)using the generated client (edited)join
you can fetch related data either using the Prisma client's fluent API or using theHowever, this doesn't allow me to join on a collection. Why is this? This is possible with the $fragment, why not in the fluent API?API: https://www.prisma.io/docs/prisma-client/basic-data-access/reading-data-TYPESCRIPT-rsc3/#relations$fragment
Albert
01/03/2020, 9:47 AMRuhan Khandakar
01/28/2020, 9:24 AMorderBy
in prisma client ?marcofaggian
03/21/2020, 12:20 AMLeo Hui
03/24/2020, 3:48 AM@Query('post')
async getPost(@Args() args, @Info() info): Promise<Post> {
return <http://this.prisma.query.post|this.prisma.query.post>(args, info);
}
here is a issue: https://github.com/prisma/prisma/issues/3103Marcel Overdijk
04/06/2020, 9:43 AMMarcel Overdijk
04/06/2020, 9:43 AMasync function main() {
const allPosts = await prisma.post.findMany({
include: { author: true },
})
console.dir(allPosts, { depth: null })
}
Marcel Overdijk
04/06/2020, 9:44 AMprisma:query SELECT `dev`.`Post`.`id`, `dev`.`Post`.`title`, `dev`.`Post`.`content`, `dev`.`Post`.`published`, `dev`.`Post`.`authorId` FROM `dev`.`Post` WHERE 1=1 LIMIT ? OFFSET ?
prisma:query SELECT `dev`.`User`.`id`, `dev`.`User`.`email`, `dev`.`User`.`name` FROM `dev`.`User` WHERE `dev`.`User`.`id` IN (?) LIMIT ? OFFSET ?
[
{
id: 1,
title: 'Hello World',
content: null,
published: false,
authorId: 2,
author: { id: 2, email: <mailto:'maria@prisma.io|'maria@prisma.io>', name: 'Maria' }
}
]
Marcel Overdijk
04/06/2020, 9:45 AMMarcel Overdijk
04/06/2020, 9:45 AMMarcel Overdijk
04/06/2020, 9:46 AMMarcel Overdijk
04/06/2020, 9:46 AMMarcel Overdijk
04/06/2020, 9:47 AMMarcel Overdijk
04/06/2020, 9:49 AMMarcel Overdijk
04/06/2020, 10:05 AMLuís Almeida
05/09/2020, 2:45 PMAndrey K
05/10/2020, 4:25 AM