Questions tagged [nexus-prisma]
62 questions
1
vote
2 answers
Prisma cannot create a user type because of array argument?
this is my InputType in schema.graphql:
input RegisterInput {
birthday: String!
email: String!
firstName: String!
gender: String!
interests: [String!]!
lastName: String!
password: String!
}
and this is my mutation:
const…

gpbaculio
- 5,693
- 13
- 60
- 102
1
vote
1 answer
"Must provide query string" error with Apollo Client on React and Nexus Graphql Server
I'm starting to work with GraphQL and the new Nexus Framework GraphQL server, which is a great product.
On my server-side, I defined my schema, I can query my database with Prisma and everything runs smoothly. I can query data also from the Nexus…

André Luiz Paiz
- 17
- 5
1
vote
1 answer
How can I delete items with relations?
I'm using prisma2, and I don't know how to delete items having relations with other models.
This is my models.
model User {
id String @default(cuid()) @id
email String @unique
password String
name String
teams Team[]
…

Jeong
- 25
- 1
- 3
1
vote
0 answers
Got error "Cannot return null for non-nullable field Joke.id" in Prisma2
I have a simple prisma.schema ⸺
model Joke {
id String @default(cuid()) @id
author Author
content String @unique
}
model Author {
id String @default(cuid()) @id
name String
jokes Joke[]
}
And this is my Query…

deadcoder0904
- 7,232
- 12
- 66
- 163
1
vote
2 answers
prismaObjectType usage produces a union type that is too complex to represent
I have a node project written in typescript with graphQl and prisma-nexus.
the usage of prismaObjectType from import { prismaObjectType } from 'nexus-prisma' produces a union type that is too complex to represent.
I can still use the project in dev…

poa
- 269
- 1
- 4
- 13
1
vote
1 answer
Prisma.io How to filter where ENUM field has ANY value
I have a handful of ENUM type fields and I would like to do a where filter where the field value is ANYTHING. Basically, I want is where
{fieldName_is_set: true}`
Does something like this exist? The only way I can think to do this is:
where: {…

Corey Snyder
- 236
- 1
- 3
- 12
1
vote
1 answer
How to upload multiple files using prisma-nexus
I need to upload multiple images using a single graphql mutation.
Following official nexus documentation, I managed to use graphql-upload library and got access to upload scalar type as below,
import { GraphQLUpload } from "graphql-upload";
import {…

Suneeth Lenin
- 285
- 1
- 4
- 10
0
votes
0 answers
why can't I make queries with Prisma in my typescript code?
import otpGenerator from 'otp-generator';
import date from 'date-and-time';
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
const generateOtp = async () => {
let otpCode = otpGenerator.generate(4,…
0
votes
0 answers
Nested object type resolvers giving type error in GraphQL Nexus while works without any type system
I am building a classroom app. While the resolver and schema works as expected without any type system, but with using nexus TS is complaining about the type errors.
I am using NextJs, Apollo Server, and graphql nexus
Currently I am using local…

sansarj17
- 11
- 2
0
votes
0 answers
How to pass authorized context type when doing a mutation with Nexus.js
I'd like to pass a authorized Context type while I am doing a mutation, but how can I do it with nexus.js?
./src/types/Context.ts
import { PrismaClient } from "@prisma/client";
export interface Context {
uid?: string | null;
prisma:…

xxxbud
- 95
- 5
0
votes
1 answer
Nexus GraphQl does not generate types when schema.prisma is changed
So, the core of the problem is described in title, but
When I commiting changes to schema.prisma my autogenerated export types in ./generated/nexus.ts don't refresh. I also don't see changes in apollo playground on my localhost:4000
I tried to…

n3dsky
- 1
- 1
0
votes
1 answer
issue when trying to use extendType in prisma nexusjs
I tried using extendtype in my project because all my files are not in a single folder, so for me to able to interact with them all I use extendType. But in the long run, i encounter an error that I can't fix at the moment.
Here is the…

david miles
- 3
- 4
0
votes
1 answer
Can not run multiple tests in a file
I'm building a GraphQL API and I want to test some resolvers and the database with jest.
Here is my helper file, where I set up the context and the Prisma Client for testing.
import { PrismaClient } from "@prisma/client";
import { ServerInfo } from…

Max
- 27
- 5
0
votes
1 answer
argument Where of type xxxxxx is required, but it was not provided
I have this strange issue . maybe i missed something
i have two tables , Vehicles and purchases
when i try to query the vehicles via
query {
vehicles{
id
}
}
It returns data normally
{
"data": {
…

Ahmed Ahmed Sayed
- 195
- 1
- 4
- 12
0
votes
1 answer
Unable to Create Multiple Connect Query in Prisma?
I am getting this error ForeignKeyConstraintViolation { constraint: Index(\"Device\") } whenever i try to run following query.
const _CreatedConnectedToMobile = await Context.Database.ConnectedToMobile.create({ 'data': {} }) <-- creates entry in db…

Sushant
- 1
- 3