perp
12/02/2021, 11:57 AMEmre Deger
12/02/2021, 2:12 PMid: 1n
) and JSON response (id: 1
) data do not match. Anyone have an idea?Octavio Augusto Barbosa
12/02/2021, 2:26 PM> pix-orm-prisma@0.0.6 postinstall /builds/fintech/pix/api/node_modules/pix-orm-prisma
> npx prisma generate
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module '/root/.npm/_npx/72/lib/node_modules/prisma/scripts/preinstall-entry.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Kindly
12/02/2021, 4:10 PMmanuel
12/02/2021, 4:35 PMDate
and the values are 1999-12-22
My schema looks like this. But If I want to insert it prisma complains that it wants a DateTime value and not a string. If i make it a DateTime value prisma adds the time again. I only want to have the type Date in the database without the time.manuel
12/02/2021, 4:59 PMDateTime
?user
12/02/2021, 5:34 PMrdunk
12/02/2021, 6:47 PMt.json
types to play nicely with nexus-prisma
? Not sure if I need to manually change some declarations after creating the scalar and schema types.
const jsonScalar = new GraphQLScalarType({ ...JSONObjectResolver, name: 'Json' });
const json = asNexusMethod(jsonScalar, 'json');
rdunk
12/02/2021, 6:48 PMProperty 'json' does not exist on type 'InputDefinitionBlock<"FoobarInput">'
Jinho Chung
12/03/2021, 2:21 AMnpx prisma db pull
with the schema appropriately updating. However when I perform a simple query (e.g. const data = await prisma.cases.findMany()
) I get:
PrismaClientKnownRequestError: Invalid `prisma.cases.findMany()` invocation
and:
code: 'GenericFailure',
clientVersion: '3.6.0',
meta: undefined
The routes that I was using before worked perfectly fine on my local version. The only difference I can think of is that the local version was Postgres 13 while the Azure version is 11. Any ideas of what is going on?Aaron Waller
12/03/2021, 4:24 AM"message": "Cannot read property 'create' of undefined",
My code is working fine on my localhost, how is that possible?Aaron Waller
12/03/2021, 5:25 AMAaron Waller
12/03/2021, 8:00 AMChris Bitoy
12/03/2021, 8:24 AMAlbin Groen
12/03/2021, 8:40 AMmanuel
12/03/2021, 9:50 AMstartDate
with type DATE
which I have as a String 1999-01-22
in my seeds. What's the correct way to have it in the new postgresdb with prisma to have only the date and not the DateTime. Because if I insert it with new Date(startDate)
I get the date in the database including the time set to 000000....manuel
12/03/2021, 9:50 AMstartDate DateTime @db.Date
user
12/03/2021, 10:06 AMSiemen Blok
12/03/2021, 11:19 AMyoav weber
12/03/2021, 12:31 PMSELECT * FROM Project WHERE "Project"."sponsor" IN ($1) OFFSET $2
What would be the $1
and $2
?user
12/03/2021, 1:23 PMFrederik
12/03/2021, 1:39 PMJohn Meyers
12/03/2021, 2:24 PM2021-12-03T13:51:22.000Z
? but shorter?Dale Weaver
12/03/2021, 5:24 PMKevin
12/04/2021, 1:24 AMtypegraphql-prisma
? There are instructions here: https://prisma.typegraphql.com/docs/advanced/adding-fields but if any new custom field gets added to a generated model class, wouldn't it just be overwritten the next time I run prisma generate
? The new field is something I added to the generate typegraphql class and does not exist in the prisma.schema file.Daniel De La Luz
12/04/2021, 3:14 AMCarlos
12/04/2021, 4:20 AMuser
12/04/2021, 11:04 AMGeorge Lewis
12/04/2021, 6:05 PMmodel OrganizationMembership {
id String @id @default(cuid())
permissions OrganizationPermission[]
dailyVerseNotification Boolean? @default(false)
organization Organization @relation(fields: [organizationId], references: [id])
organizationId String
profile Profile? @relation(fields: [profileId], references: [id])
profileId String?
user User? @relation(fields: [userId], references: [id])
userId String?
startDate DateTime @default(now())
updatedAt DateTime @updatedAt
meetingRoomReservationModerated MeetingRoomReservation[]
@@unique([userId, organizationId])
// @@index([profileId])
// @@index([userId])
// @@index([organizationId])
// @@unique([profileId, organizationId])
}
and a resolver to query all the organizationMemberships as follow
async organizationMemberships(
_parent: any,
args: OrganizationMembershipsArgs,
ctx: ContextInterface
): Promise<OrganizationMembership[]> {
const organizationMemberships = ctx.prisma.organizationMembership.findMany({
where: {
id: args.where?.id,
userId: args.where?.user?.id,
organizationId: args.where?.organizationId?.length
? { in: args.where.organizationId }
: undefined,
user: {
profile: {
name_search_key: {
contains: args.where?.name_search_key,
mode: 'insensitive'
}
}
}
},
skip: args.skip,
take: args.first
})
The problem is that when i run the query (Searching by OrganizationId) I only get the records that have a user entity not the rest (with null user). can anyone help?Daniel
12/05/2021, 3:33 AM// prisma schema file
model Item {
id String @id @default(uuid())
name String
}
// code:
try {
await prisma.$transaction(async () => {
await prisma.item.create({
data: {
name: 'item 1',
},
})
await prisma.item.create({
data: {
name: 'item 2',
},
})
throw new Error('Oh no something went wrong.')
})
} catch (err) {
console.log('Rolled back?')
}