Tag: prisma
-
GraphQL filter/order based on result count of relation
0 I am kind of new to GraphQL world and i am stuck at a, i would say, very basic problem. I dug around couple of docs and guides and i could not find any hint if it is even possible or not with GraphQL or what might be a workaround. What i want to…
-
Prisma query returns null, when data exists
2 I’ve built a Nestjs app with Prisma and GQL. I just changed computer (from a Mac to PC) and all of a sudden my login mutation seems to have stopped working, literally the only one… Here is some code: auth.resolver.ts: @Mutation((returns) => AuthenticatedUser) async login( @Context() { res }: Auth.GqlContext, @Args(‘payload’, { type: ()…
-
can’t persist user session in apollo-graphql with express-session
0 I have nextjs-nodejs project, where I use apollo-graphql and Prisma, so when I create a user, I should send a session to "getSession" function, which is a mutation, and this mutation uses express-session to save the user info like that: getSession: async ( _: any, args: any, { prisma, session }: GraphqlContext ) =>…
-
Prisma throws an error “TypeError: cannot read property findmany of undefined”
5 I wanted to make a chat app to practice working with graphql and node, for database I used prisma. I was doing everything like in this tutorial. https://www.howtographql.com/graphql-js/0-introduction/ I just changed variable names. so I have this code const { PrismaClient } = require(‘@prisma/client’) const prisma = new PrismaClient() const resolvers = { Query:…
-
How can I use Prisma types on a nest.js GraphQL query argument
0 I’m working on a simple GraphQL query that allows me to fetch a list of users. I want to be able to sort them through my request. I’m using Prisma as an ORM. As per the documentation, my service simply looks like this: /** * Find all users */ findAll({ skip, take, cursor, where,…
-
use nexus-prisma without prisma client
0 I am planning on using prisma for building the database and migrations, I am not going to use prisma client as there are some limitations I am hitting since prisma does not use native joins. I also want to use nexus prisma to auto generate types for my graphql api. However, I see that…
-
Remove all items in table with Prisma2 and Jest
2 I would like to know how can I remove all items in table with Prisma2 and Jest ? I read the CRUD documentation and I try with this : user.test.js …. import { PrismaClient } from "@prisma/client" beforeEach(async () => { const prisma = new PrismaClient() await prisma.user.deleteMany({}) }) … But I have an…
-
can’t set members array in mongodb with prisma
0 I use Prisma, apollo-graphql, and Mongoose to create chat applications but I have this problem, MongoDB gets only _id when I try to create a chat. Prisma Schema: generator client { provider = "prisma-client-js" } datasource db { provider = "mongodb" url = env("DATABASE_URL") } model User { id String @id @default(auto()) @map("_id") @db.ObjectId…
-
Prisma Appsync generator not working when run the npm run deploy command
0 I’m using local mode successfully, but trying to deploy, I can’t complete the command npm run deploy. cdk synth never complete the step: RUN npm install –global [email protected] Step by step I’m test with nodejs versions 16 & 18 "aws-cdk": "2.99.1", "aws-cdk-lib": "2.99.1" I’m testing default tutorial from https://prisma-appsync.vercel.app/quick-start/getting-started.html Anyone can…
-
Prisma Datamodel: Primary key as a combination of two relational models
6 I have a problem in Prisma data modeling where I have to constrain that a user can submit only one review for a product. I have following design for the non-constrained situation. Should Customer and Product be combined into a primary key in ProductReview model, or should this constraint be imposed at the application…