Questions tagged [prisma-graphql]

Prisma turns your database into a GraphQL API.

Prisma lets you design your data model and have a production ready GraphQL API online in minutes.

The Prisma GraphQL API provides powerful abstractions and building blocks to develop flexible, scalable GraphQL backends.

416 questions
4
votes
1 answer

How to retrieve a sub query in prisma client with same table?

select * from WeeklyChallengeCourses where weekly_challenge_id = (select weekly_challenge_id from WeeklyChallengeCourses where course_id = 210); Result will be the below selected…
Ilyas Arafath
  • 511
  • 7
  • 13
4
votes
1 answer

prisma create with nested connect throws error

I'm running into a problem, where connecting a model to multiple items in another model, in a create call seems to throw the following error: The error: Invalid `prisma.movie.create()` invocation: Error occurred during query…
4
votes
0 answers

How to mock Prisma (via Proxy) in Jest 27

Our Prisma setup is as follows: // server/database/prisma.ts import { Prisma } from 'database/generated/prisma-client'; const client = new Prisma({ endpoint: PRISMA_ENDPOINT, secret: PRISMA_SECRET, debug: PRISMA_DEBUG, }); // Add a proxy…
Matthew Herbst
  • 29,477
  • 23
  • 85
  • 128
4
votes
1 answer

Error Assertion `args[3]->IsInt32()' failed

Version: v12.19.0 Platform: Linux ayungavis 5.4.0-48-generic #52~18.04.1-Ubuntu SMP Thu Sep 10 12:50:22 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux Subsystem: What steps will reproduce the bug? I tried to follow the tutorial from Adding a Database to…
Wahyu Kurniawan
  • 169
  • 3
  • 9
4
votes
1 answer

Handling file upload with nexus-prisma graphql

I'm trying to upload a file from my frontend app to my server but I keep getting this weird error and have no idea why it's happening. Error is frontend: Variable "$file" got invalid value {}; Expected type Upload. Upload value invalid. Error in…
Raji Hawa
  • 156
  • 1
  • 6
4
votes
3 answers

Prisma 2 query to return records only that are associated with ALL of the provided tag IDs

I have tables Principles and Tags. And there is a many-to-many relation between them (joined implicitly). Without using prisma.raw, how can I run the following query? SELECT p.id, p.title, p.description, p.createdAt, p.modifiedAt FROM principle…
Ryan
  • 22,332
  • 31
  • 176
  • 357
4
votes
2 answers

Input Object type XXX must define one or more fields in prisma 2.0

I have the following schema.prisma file: model Account { id Int @default(autoincrement()) @id name String transactions Transaction[] } model Transaction { id Int @default(autoincrement()) @id accountId Int account Account…
Daniel
  • 7,684
  • 7
  • 52
  • 76
4
votes
1 answer

I am getting the following errors saying 'Could not freeze ./node_modules/

I'm building a web app using GraphQL and React. When compiling the front-end/client I see the following errors: Is there something else I can provide to help debug this? Thank you!
4
votes
1 answer

How can I add a share to GraphQL Bin option to my Apollo server playground?

I am using Apollo server to implement a GraphQL API, which automatically gives me a GraphQL Playground. According to the GraphQL Playground docs I should have (or at least be able to enable) a "Share" feature that will create a GraphQL Bin link…
Calaway
  • 714
  • 6
  • 12
4
votes
1 answer

How to do a nested mutation resolver with nexus-prisma

I have the following datamodel: type Job { // ... example: String selections: [Selection!] // ... } type Selection { ... question: String ... } I define my object type so: export const Job = prismaObjectType({ name:…
Trufa
  • 39,971
  • 43
  • 126
  • 190
4
votes
1 answer

Is better pass prisma object through context to resolvers or use it directly?

I want to know if is better or there is any difference in use prisma client directly in resolvers or pass it through context. In the official documentation it is passed through context: const { prisma } = require('./generated/prisma-client'); const…
4
votes
1 answer

Define required or not for array fields in the prisma datamodel

What are the differences of followings. when to use a one over the other? zones: [Zone] zones: [Zone!] zones: [Zone]! zones: [Zone!]!
Dulara Malindu
  • 1,477
  • 4
  • 18
  • 37
4
votes
2 answers

Row level security using prisma and postgres

I am using prisma and yoga graphql servers with a postgres DB. I want to implement authorization for my graphql queries. I saw solutions like graphql-shield that solve column level security nicely - meaning I can define a permission and according to…
brafdlog
  • 2,642
  • 1
  • 18
  • 21
4
votes
2 answers

Query to get data ordered by the number of items in a relation

Let’s say I have this typical datamodel, the one used in many tutorials: type User { id: ID! @unique name: String! posts: [Post!]! } type Post { id: ID! @unique title: String! content: String! published: Boolean! @default(value:…
JV Lobo
  • 5,526
  • 8
  • 34
  • 55
4
votes
1 answer

How to set the "cluster" property in prisma.yml

Thanks for reading my question in advance. I am just start to use graphql and prisma following this tutorial. I have the following Error when Deploying the Prisma database service: Error: No cluster set. Please set the "cluster" property in your…
user6080689