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

How do I create a query on a type which includes a relation in graphql/prisma?

I have a type "Contract" which includes a "User" which is a relation. I am looking to write a mutation to include the User. I thought that User just stored the ID so my mutation looked like this: mutation createContract { createContract( data:…
Matthew Player
  • 318
  • 4
  • 17
0
votes
1 answer

How to make multiple connects in one GQL mutation?

So I have the following in my Prisma datamodel. There's a relationship between the games and the characters, where the characters can appear in multiple games. Also the characters should be able to be listed on the games when the games alone are…
lanierc
  • 182
  • 2
  • 12
0
votes
1 answer

Is there a way to batch update objects in prisma using a nested create

prisma v1.28.3, nodeJs: v10.15.3 Let's say we have the following prisma definitions type ScheduledCharge { processedAt: DateTime! transactions: [Transaction!]! } type Transaction { id: ID! @unique amount: number } Now, given that we have a…
0
votes
2 answers

OneToMany relation working on Prisma Database, but not on server

In the mutation to create posts, I am using this code: async function savePost(parent, args, context, info){ let data = {...args} delete data.categories delete data.status if (!context.request.userId) { throw new Error('Please SignIn…
0
votes
1 answer

Prisma graphql computed fields on relations

I have the following datamodel: type Tvshow { id: ID! @unique title: String! pricing: [Pricing] startDate: DateTime! endDate: DateTime! subscribers: [Tvshowsubscription!] ..... } type FavoriteTvshow { id: ID! @unique tvshow:…
Adrián E.
  • 653
  • 2
  • 7
  • 21
0
votes
1 answer

Using Prisma GraphQL-Yoga as an Express/Node application: how can I call GraphQL mutations server-side?

I'm trying to do image processing on Node and am using a Prisma GraphQL-Yoga server to manage the queue of jobs. A React/Apollo front end that queues the jobs, that is, it calls a Mutation on the server which stores the jobs in the DB via Prisma.…
Cerulean
  • 5,543
  • 9
  • 59
  • 111
0
votes
1 answer

Use array as variable for GraphQL Query

I want to query a nested field for multiple variables. In this case, I want to query RPR, but only return RPR if the label of the nested Region is given. One variable for the nested Region (field: label) works fine, but how can I filter on multiple…
0
votes
2 answers

GraphQL query for find equal field on realations

I have a schema for GraphQL like this (it's good to mention that I'm using Prisma) : enum PollResult { HOME_WIN AWAY_WIN DRAW } type UserPoll { id: ID! @unique user: User! predict: PollResult! } type Poll { id: ID! @unique away:…
MBehtemam
  • 7,865
  • 15
  • 66
  • 108
0
votes
1 answer

How to use same generated ID in two fields prisma-graphql

I'm implementing a graphql prisma datamodel. Here I have a type called BankAccount . I may need to update and delete them as well. I'm implementing this as immutable object. So, when updating I'm adding updating the existing record as IsDeleted and…
Thidasa Pankaja
  • 930
  • 8
  • 25
  • 44
0
votes
1 answer

Prisma.io many to many relationships generates an error

I have a graphql schema type Post { id: ID! @unique createdAt: DateTime! updatedAt: DateTime! tags:[Tag!]! } type Tag { id: ID! @unique createdAt: DateTime! updatedAt: DateTime! name: String! posts:[Post!]! } So, a tag…
Svitlana
  • 2,324
  • 4
  • 22
  • 31
0
votes
0 answers

Set hostname in GraphQL server

Would you please let me know how I can set the host name in GraphQLServer (graphql-yoga)? I want to set the hostname to my domain name (which is located on a Ubuntu server) and use it instead of "localhost", but unfortunately it doesn’t work. I used…
0
votes
1 answer

Prisma config error on docker swarm deploy

I'm trying to deploy a prisma service on my docker swarm, but received: error: "services.prisma.environment.2 must be a string" With the following docker-compose, the service runs fine. version: '3.2' services: prisma: image:…
0
votes
2 answers

Prisma Query resolver fails: "invalid argument for the where selector"

I set up prisma with a graphql yoga server and have both GraphQL playgrounds available. I could successfully create a conversation that I'm now trying to retrieve. I can't get this simple resolver to work in the Yoga GraphQL Playground: const…
Greg Forel
  • 2,199
  • 6
  • 25
  • 46
0
votes
1 answer

Features work, but console delivers extraneous error: "Variable "$id" of required type "ID!" was not provided."

My CRUD operations work. But many of them also generate a single, specific console error I haven't been able to track down. [GraphQL error]: Message: Variable "$id" of required type "ID!" was not provided., Location: [object Object], Path:…
0
votes
1 answer

Filter by id of a relation

I want to filter in prisma for a relation id and get the same entity, not the related one back. Simple example: type User { firstName: String! lastName: String! isOwner: [Meta!]! @relation(link: INLINE, name: "User_Meta_Owner") id: ID!…