Isidoro Ferreiro
12/22/2020, 6:57 PMcontextType: {
module: join(__dirname, "types.ts"),
export: "Context",
alias: "ctx"
}
zeus
12/24/2020, 1:54 PMhttps://media1.giphy.com/media/damYg6Mana2CHXfuz5/giphy-downsized.gif?cid=6104955eb67[…]51fd87958eb995e0ee2bfdcae526471cd0e8&rid=giphy-downsized.gif▾
Jaafari El Housseine
12/25/2020, 9:12 AMManthan Mallikarjun
12/28/2020, 1:47 AMericsonluciano
12/28/2020, 6:02 AMDiogo Luis
12/28/2020, 11:04 AMDiogo Luis
12/28/2020, 11:05 AMDiogo Luis
12/28/2020, 11:05 AMSpencer Curry
12/28/2020, 3:46 PMuser { profileInfo { fName, lName}}
resolver prisma.users.findOne({include: {profileInfo: true}})
OR
resolver prisma.profileInfo.findOne({where: {userId: args.userId}})
fcholakoski
12/28/2020, 8:51 PMbntzio
12/28/2020, 9:56 PMconnectOrCreate
query in a many-to-many (explicit) relation.
tags: {
connectOrCreate: {
where: { name: 'General' },
create: { tags: { create: { name: 'General' } } }
}
}
Many thanks!Philipp Rajah Moura Srivastava
12/29/2020, 12:48 AMawait prisma.events(invitedQuery).$fragment(fragment);
which I discovered a while back. However I would like to get a list of users that are followers of a given user as well as all the other saclar types that make up a user. I could see myself doing it with the pattern above but it doesn’t seem like it’s the best way to do it. I would like to know if there’s a way to have the user returned from the prisma client with a field that is a list of users. I am using prisma-client-lib v1.34.10. This seems like a very basic operation but I haven’t found anything in the docs. I did find something to do with the info parameter and prisma-bindings but I don’t think that’s relevant here.
Any help would be appreciated, much thanks.Eliya Cohen
12/29/2020, 10:07 AMtsc
and then run the compiled app.ts
but it looks like I get a runtime error due to missing root typing:
Error: Root typing path /home/eliya/projects/X/packages/server/build/context.ts for the type context does not exist
Keanu Gargar
12/29/2020, 11:45 AMbntzio
12/29/2020, 11:55 AMchristian
12/30/2020, 12:33 AMwhere: {
date_: {
gte: Date.now()
}
}
I also tried new Date().getTime()
but it keeps failing. Any ideas?christian
12/30/2020, 12:41 AMPhilipp Rajah Moura Srivastava
12/30/2020, 8:37 PMMichael Reh
12/31/2020, 8:54 AMPieter
12/31/2020, 10:29 AMPieter
12/31/2020, 10:35 AMTaylor
01/01/2021, 3:15 PMTaylor
01/01/2021, 3:15 PMPhilipp Rajah Moura Srivastava
01/01/2021, 11:20 PMJoe
01/03/2021, 7:09 PMconst server = new ApolloServer({
gateway,
subscriptions: false,
context: ({ req }) => {
const user = req.user || null;
console.log("Prisma: " + prisma);
return { prisma, user };
}
})
Resolver:
<session request returning user>
console.log("Resolver: " + context.prisma);
context.prisma.account.create({
data: {
email: email,
password: password
},
});
Output:
Prisma: [object NewPrismaClient]
Resolver: undefined
If I stringify the context, I get:
Resolver: {"user":null,"_extensionStack":{"extensions":[]},"_shield":{"cache":{}}}
the prisma context object is always undefined in the resolver, what I am not understanding here?stephan
01/04/2021, 12:57 PMMartïn
01/04/2021, 1:04 PMSpiros - Product at Prisma
Dan
01/06/2021, 1:17 AMDan
01/06/2021, 1:18 AM