Joey
06/21/2021, 11:58 AMenum
of integers in prisma schema? Say I want to build an NPS score system and part of the data is an upvote
which translates to 1
and a downvote
which translates to 0
?Julien Goux
06/21/2021, 12:28 PMwarn Versions of prisma@2.25.0 and @prisma/client@2.20.1 don't match.
?Julien Goux
06/21/2021, 12:29 PMyarn cache clean
Julien Goux
06/21/2021, 12:29 PMJulien Goux
06/21/2021, 12:33 PM@prisma/client
’s package.json installed in my node_modules and it’s 2.25.0
as well. This is also 2.25.0
in my yarn.lock xDJulien Goux
06/21/2021, 12:33 PM@prisma/client@2.20.1
is coming from 🤔Alisia Reveli
06/21/2021, 1:22 PMJustin Ellingwood
06/21/2021, 3:16 PMMichael Stewart
06/21/2021, 8:11 PMprisma-chobo
06/22/2021, 12:57 AMprisma-chobo
06/22/2021, 12:57 AMArun Kumar
06/22/2021, 7:08 AMmyField: 78n
Arun Kumar
06/22/2021, 7:08 AMArun Kumar
06/22/2021, 7:34 AMThe following models were enriched with an @@ignore taken from your previous datamodel
Code 15
[
{
"model": "myModel"
}
]
``````Orkhan Rustamli
06/22/2021, 7:54 AMNichita Z
06/22/2021, 9:22 AMmodel Test {
id Int @id @default(autoincrement())
pendingFollowers Test[] @relation(name: "relation")
pendingFollowing Test[] @relation(name: "relation")
}
And I want to check if Test(id 1) has a specific Test(id 10) in its pendingFollowing list:
const user = await this.prisma.test.findFirst({
where: {
id: 0,
pendingFollowing: {
some: {
id: 10
}
}
}
})
This is the best way I could find, but it feels.. a bit weird, is this the standard way of doing this?user
06/22/2021, 9:36 AMuser
06/22/2021, 9:47 AMuser
06/22/2021, 9:49 AMLuca Nigido
06/22/2021, 11:37 AMFelipe Martinelli
06/22/2021, 12:14 PMArun Kumar
06/22/2021, 12:49 PMArun Kumar
06/22/2021, 12:50 PM+ id: Int
}
}
Argument id for data.id is missing.
Ian
06/22/2021, 1:02 PMIan
06/22/2021, 1:05 PMJ.Paul
06/22/2021, 1:29 PMDavid Panart
06/22/2021, 1:41 PMschema.prisma
• handling enums
?
• anything else worth knowing regarding the incoming features / possibilities ? 🙂Edmir Suljic
06/22/2021, 1:41 PMimport { GraphQLServer } from "graphql-yoga";
import { resolvers } from "./resolvers/index";
import { PrismaClient } from "@prisma/client";
import "reflect-metadata";
export interface Context {
prisma: PrismaClient;
request: any;
}
const main = async () => {
const prisma = new PrismaClient();
const server = new GraphQLServer({
typeDefs: "./src/schema.graphql",
resolvers,
context: ({ request }) => ({ request, prisma } as Context),
});
server.start({ port: process.env.PORT || 4000 }, () => {
console.log("The server is up!");
});
};
main().catch(console.error);
Nichita Z
06/22/2021, 2:23 PMthis.prisma.user.findUnique({where: {id: 1}, include: {_count: true}})
dfau
06/22/2021, 2:50 PMid String @id @db.Uuid @default(dbgenerated("gen_random_uuid()"))
is there a way to use a function made by me instead of postgresql default one? For reference, my use case would be something like
orderNumber BigInt @default(dbgenerated("random_between(99999, 1000000)"))