Questions tagged [nexus-prisma]

62 questions
0
votes
2 answers

Nexus field resolver parent type is not nullable

Anyone can query user with any fields they want, but gor some reason q_id field resolver parent type includes all fields. How can i fix parent type and make it nullable for each field? I want to load q_id only when q_is_public (it works, but i need…
ZiiMakc
  • 31,187
  • 24
  • 65
  • 105
0
votes
1 answer

Command not found: nexus

I'm using nexus and nexus-prisma-plugin for my backend. I pulled my backend from GitHub and installed all packages. Now when I want to run the nexus server I got the error zsh: command not found: nexus. I also work on a Linux computer and there it's…
wyndham007
  • 181
  • 3
  • 14
0
votes
1 answer

Entity money transactions schema design

I'm trying to create a many-to-many relationship between two models: Entity and Taransaction model Entity { id String @id @default(cuid()) name String purchases Transactions[] // references the source field on Transaction sales…
brielov
  • 1,887
  • 20
  • 28
0
votes
0 answers

Variable \"$data\" of required type "Type" was not provided

I have a survey creation mutation and I want to create nested records with survey creation mutation. I am using query variables to set the data for mutation. When I create only survey without nested attributes it works successfully but when I add…
0
votes
1 answer

Retrieving related model of a deleted model in Prisma 2

Hello guys here is the scenario i have; model User { id Int @default(autoincrement()) @id ... posts Post[] comments Comment[] } model Post { id Int …
MoffatMore
  • 67
  • 1
  • 8
0
votes
0 answers

Nexus GraqphQL server does not restart

I'm running a Graqphql Server using nexus and nexus-prisma-plugin, npx nexus dev runs the server but takes a few seconds and the server does not restart on file changes. There is nothing provided in the documentation and I thought nexus dev was…
sameer kashyap
  • 1,121
  • 1
  • 9
  • 14
0
votes
1 answer

Why nexus dev command runs app twice, and how to fix it?

I created super simple application using nexus graphql framework. First step like this: https://www.nexusjs.org/#/tutorial/chapter-1-setup-and-first-query I api/app.ts i typed code: const uid = require('uid') let i = 0; const sleep = async (ms:…
Daniel
  • 7,684
  • 7
  • 52
  • 76
0
votes
1 answer

How to make dummy context when testing graphql resolvers?

I want to test some graphql mutations. but I am not sure what to give as context while writing test. for example, I want to call createPost mutation: it('admin should create a post', async () => { await createPost( null, { …
Ashik
  • 2,888
  • 8
  • 28
  • 53
0
votes
0 answers

Create Prisma 2 Mutation on many to many field using Nexus

Hello guys i'm using prisma 2 in my node js serve and below is how i defined the schema of my models model Interest { id Int @default(autoincrement()) @id name String profile Profile[] @relation(references: [id]) …
MoffatMore
  • 67
  • 1
  • 8
0
votes
0 answers

Avoid lots of nested SQL queries when using graphql / nexus / prisma / yoga

Suppose have the following kind of graphql schema built with nexus-prisma library : Root : contains id and list of A A : contains id and list of B B : contains id and list of C C : contains id I have a graphqlServer built this way : import {…
Drico
  • 1,284
  • 15
  • 33
0
votes
2 answers

Prisma2: use user id in related table in create function

I am trying to create a user that is the child of another user. I am managing this relationship by having a User table where all users, parents and children, are stored. There is a seperate table that just has the id of the child and the id of the…
Tristan
  • 341
  • 4
  • 17
0
votes
2 answers

Extend prisma Docker image with another layer of node express image

I have got a prisma server image from dockerhub which is prismagraphql/prisma:1.34 The above prisma image in order to run on PORT 4466 requires database connection string and the same is passed as an environment variable using a docker-compose…
jeril
  • 1,109
  • 2
  • 17
  • 35
0
votes
1 answer

Prisma deploy - authentication error for local deployment

I am trying to run prisma deploy using a local prisma server running on port 4466 but when I run prisma deploy I get this message Authenticating... Opening https://app.prisma.io/cli-auth?secret=$2a$08$u3VSbu6GSxSV8l86BFs24O in the browser Could not…
jeril
  • 1,109
  • 2
  • 17
  • 35
0
votes
1 answer

Possibility to only retreive owners data with prisma2 and nexus

When posting a query i want to retreive only the data that is assigned to the current user (id). I retreive and set the userId with a middleware function that contains; const userId = tokenPayload['claims']['uid']; ctx.userId = userId; Base on the…
RMCS
  • 383
  • 3
  • 17
0
votes
1 answer

How resolve a custom nested extendType resolver with prisma nexus?

I need resolve a custom resolver from a prisma type. But I can't access to children in this case course or subjects, my person type only resolve data over one level. Deps: "nexus": "0.11.7", "nexus-prisma": "0.3.7", "prisma-client-lib":…
Raul
  • 165
  • 1
  • 1
  • 11