Aaron Waller
12/27/2021, 12:11 PMMutation: {
createPost: (parent, args) => {
return prisma.content.create({
postinput: {
name: args.name,
content: args.content
}
})
}
}
But it is not working and giving me the following error:
Unknown arg postinput
in postinput for type Content. Did you mean select
?\nArgument data is missing.Aaron Waller
12/27/2021, 12:14 PMtype Mutation {
createPost(name: String, content: String): Post!
}
and my resolver like this:
Mutation: {
createPost: (parent, args) => {
return prisma.content.create({
data: {
name: args.name,
content: args.content
}
})
}
}
it is working fine
The problem is I want to keep the PostCreateInput input to add a lot of fields thereJuan Carlos Blanco Delgado
12/27/2021, 12:35 PMJoonatan
12/27/2021, 1:15 PMDiego Serrano
12/27/2021, 8:04 PMDiego Serrano
12/27/2021, 8:05 PMjoao.santos
12/28/2021, 9:28 AMhj yuiyui
12/28/2021, 10:20 AMexport async function savePageView(website_id, session_id, url, referrer) {
const ref = new Referer(referrer);
return runQuery(
prisma.pageview.create({
data: {
website_id,
session_id,
url: url?.substr(0, URL_LENGTH),
referrer: (await getRef(referrer)) //put referrer "direct" if parameters in function is empty,
referrer_group: ref.referer ? ref.referer : ref.uri.hostname,
referrer_medium: ref.medium,
},
}),
prisma.pageview.update({
where: {
referrer: "direct",
},
data: {
referrer_group: "Visites directes",
},
})
);
}
hj yuiyui
12/28/2021, 11:43 AMreferrer
in where.referrer for type pageviewWhereUniqueInput. Did you mean select
?"Γιώργος Κραχτόπουλος
12/28/2021, 12:30 PMwhere: { deletedAt: null }
? Middleware is only called once on findUnique()
call, but I want a middleware to run on every query operation. The following:
await prisma.cart.findFirst({
where: { id: 107 },
include: { foods: true } },
});
will call middleware prisma.$use()
only once, and not for the DB query when fetching the relation foods
Nischal
12/28/2021, 1:25 PMMattèo Gauthier
12/28/2021, 1:54 PMOAuthAccountNotLinked
from next-auth due to prisma seed)James
12/28/2021, 4:57 PMlawjolla
12/28/2021, 5:56 PMimport { Deal } from "prisma1/generated/prisma-ts"
const calculateDealProfit = (deal: Deal): number => {
....
}
Anony Mous
12/28/2021, 8:24 PMAnony Mous
12/28/2021, 8:24 PMAnony Mous
12/28/2021, 8:24 PMAnony Mous
12/28/2021, 8:24 PMAnony Mous
12/28/2021, 8:24 PMAnony Mous
12/28/2021, 8:24 PMSpencer Kifell
12/28/2021, 9:22 PMSpencer Kifell
12/28/2021, 9:26 PMChris Tsongas
12/29/2021, 5:07 AMfindMany()
which is a bummer because if I just return that to Apollo it throws an error like "message": "Cannot return null for non-nullable field Query.employeeNotes."
. Is this a known issue that will get fixed? In the meantime as a workaround I have to await the result of the query and use the nullish coalescing operator to return an empty array if there are no results:
async getEmployeeNotes(employeeId: string): Promise<EmployeeNote[]> {
return (
(await prisma.employee
.findUnique({
where: {
id: employeeId,
},
})
.employeeNotes()) ?? []
)
},
Chris Tsongas
12/29/2021, 5:32 AMgetEmployeeNotes(employeeId: string): Promise<EmployeeNote[]> {
return prisma.employeeNote.findMany({
where: {
employeeId,
},
})
},
I'm just not sure which is better performance-wise in terms of the number of queries created and the GraphQL n+1 problem which I don't understand yet but plan to read up on.Julien Goux
12/29/2021, 1:25 PMJulien Goux
12/29/2021, 1:27 PMJakub Figlak
12/29/2021, 1:47 PMUnknown arg `country` in data.country for type RegionUncheckedUpdateInput. Did you mean `countryId`? Available args:
type RegionUncheckedUpdateInput {
id?: String | StringFieldUpdateOperationsInput
name?: String | StringFieldUpdateOperationsInput
createdAt?: DateTime | DateTimeFieldUpdateOperationsInput
updatedAt?: DateTime | DateTimeFieldUpdateOperationsInput
countryId?: String | StringFieldUpdateOperationsInput
}
This is probably not PrismaClientKnownRequestError
cause it's missing my nest filter.Shmuel
12/29/2021, 2:17 PMPrismaClientValidationError: Unknown arg `follower` in data.followers.create.0.follower for type FollowsCreateWithoutFollowerInput. Did you mean `following`?
Argument following for data.followers.create.0.following is missing.
I posted this question with more details on stackoverflow https://stackoverflow.com/questions/70520589/prisma-many-to-many-self-relation-error-due-to-relation-and-generated-type-inpu
If anyone has any ideas I would greatly appreciate it.
Thanks in advance.Winter
12/29/2021, 2:29 PMBarnaby
12/29/2021, 2:30 PM