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
3
votes
1 answer

Why isn't my schema connecting Product and Category?

Tryign to do I am trying to Query my Products and to also show what Categories they are under. Here is my Prisma Schema model Product { id String @id @default(uuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt name…
Esore
  • 243
  • 2
  • 9
3
votes
1 answer

Nested create query using Prisma returns undefined

I am working on a workout app using Graphql Prisma and Postgres as my backend. So far my prisma schema is as follows: // This is your Prisma schema file, // learn more about it in the docs: https://pris.ly/d/prisma-schema generator client { …
PynkFysh
  • 31
  • 2
3
votes
0 answers

How to handle union types globally like apollo-client?. Typescript throws Property 'urls' does not exist on type 'Media' for graphql Union

I have a union type Media = Image | Emoji and I'm using it on many different and deeply nested entities in my graphql schema. I'm also using graphql-code-generator to generate types. I used to use apollo-client to handle my requests and it was…
3
votes
1 answer

Prisma: Error: P1017 Server has closed the connection

I have a prisma 2 project with nodejs server all things was working pefectly, and when I upgraded prisma from 2 to "3.0.2" version the prisma db push command no longer work and it throws this error: Error: P1017 Server has closed the connection. I…
Ghyath Darwish
  • 2,614
  • 4
  • 15
  • 31
3
votes
1 answer

How do you declare a database default in prisma using @default and degenerated()?

would like to declare a default binary value in the resulting sql migration file. I have tried using @default(dbgenerated(“UUID_TO_BIN(uuid())”) but the expression does not get implemented in the resulting SQL file.
Mnengwa
  • 217
  • 4
  • 10
3
votes
1 answer

graphql query with args not working for user id

I am bamboozled. I initially created the user query and it was giving me errors that I assumed were syntax errors. But then I created an identical query for vehicles which works perfectly. I have a suspicion that it's related to the ID! type but I…
Ani T
  • 65
  • 2
  • 6
3
votes
2 answers

how to delete relational item in prisma2

My data model includes the following nodes: model User { id Int @id @default(autoincrement()) name String posts Post[] } model Post { id Int @id @default(autoincrement()) body String user …
3
votes
1 answer

Prisma2 prisma introspect returning weird values for foreign keys

I have two tables, User and Relationship. The tables are used to store a parent child relationship. I am using Postgres // schema.sql CREATE TABLE "public"."Relationships" ( id SERIAL PRIMARY KEY NOT NULL, parent_id INT NOT NULL, …
Tristan
  • 341
  • 4
  • 17
3
votes
1 answer

How to set up a different database for testing in prisma?

I want to use a different database for testing my app instead of local database. this is my env file # Environment NODE_ENV=development # Backend API_PORT=4000 APP_SECRET=omg DASHBOARD_URL=http://localhost:1234 #…
Ashik
  • 2,888
  • 8
  • 28
  • 53
3
votes
2 answers

Partial Update Mutations(GraphQL)

How can I be able to update a node with only one field change and leave the rest of the fields alone? My User Type type User { id: ID! user_id: String! username: String! email: String! role: Role! …
Kinara Nyakaru
  • 489
  • 6
  • 14
3
votes
1 answer

How to handle multi tenancy in graphql server ? Apollo/Prisma/ Hasura anything has this pugin?

Im trying to create a graphql server but in my case i need to setup multiple servers of diffrent customers. How can I implement multitenancy in graphql server? Tried with apollo and prisma but none of them really worked. Any libraries or plugin…
sooraj
  • 324
  • 1
  • 8
3
votes
0 answers

Prisma not generating field in WhereInput for an array of strings

I've been using GraphQL for probably 8 or so months. I've never run into a problem like this before. When I make a change in my datamodel, and run the command which generates a prisma file. I have an existing field in a table which's type is an…
The Hubba
  • 43
  • 1
  • 2
  • 5
3
votes
1 answer

Prisma Connection WhereInput for Array of enum values?

Doing this query { postsConnection(where: { status: PUBLISHED }) { aggregate { count } edges { cursor node { id slug } } } } gives me postsConnection of published posts. The Post…
3
votes
0 answers

Subscriptions are not stable. Prisma terminates with a GqlConnectionTerminate error

I just implemented subscriptions in my API which use graphql-yoga. I have one prisma server which have the following config: databases: default: connector: postgres host: database: prisma port: 5432 user: admin password:…
Chrishan
  • 4,076
  • 7
  • 48
  • 67
3
votes
3 answers

prisma error: Could not connect to server at http://localhost:4466

I'm having trouble with deploying prisma. The steps I've taken are the following: create a new folder run prisma init select postgresql and fill in the required information. complete the installation Now when i got to use docker-compose up -d it…
Strahinja Ajvaz
  • 2,521
  • 5
  • 23
  • 38