Git Product home page Git Product logo

Comments (6)

T-D3V avatar T-D3V commented on July 30, 2024 1

Yep I'll close it I mean this was from a few months ago and a lot has changed so no need to keep this issue open.

from nexus-prisma.

willpots avatar willpots commented on July 30, 2024

Do you have your nexus object definitions handy? I'm seeing this issue too when I try and create a field on the nexus schema mapping to another collection.

model User {
  id     String   @id @default(auto()) @map("_id") @db.ObjectId
  homes  Home[]
}

model Home {
  id       String   @id @default(auto()) @map("_id") @db.ObjectId
  userId   String   @db.ObjectId
  user     User     @relation(fields: [userId], references: [id])
}
import {User as PrismaUser} from 'nexus-prisma';

const User = objectType({
  name: 'User', 
  definition: (t) {
    t.field(PrismaUser.id);
    t.field(PrismaUser.homes);
  }
}
/Users/potter/workspace/taxes/server/node_modules/nexus/src/builder.ts:1743
  return new Error(`${name} was already defined and imported as a type, check the docs for extending types`)
         ^
Error: NEXUS__UNKNOWN__TYPE was already defined and imported as a type, check the docs for extending types

from nexus-prisma.

simonjoom avatar simonjoom commented on July 30, 2024

I found this issue when upgrading prisma
you need to look for type ${yourmodel}OrderByInput in your graphql code generated

and change it to ${yourmodel}OrderByWithRelationInput

because OrderByInput not exist for the last prisma
then you can restart your app and have a try

from nexus-prisma.

baconcheese113 avatar baconcheese113 commented on July 30, 2024

Getting same thing after attempting to migrate to nexus-prisma from nexus-prisma-plugin, not sure where to look

from nexus-prisma.

AhmedElywa avatar AhmedElywa commented on July 30, 2024

This bug means you are using a type that does not exist.

  • nexus had an issue because it gives you NEXUS__UNKNOWN__TYPE instead of the type name.
  • It's not a bug in nexus-prisma
  • You need to review your code and find what type you use and you didn't create it.
  • The nexus-prisma-plugin t.crud generated some inputs like XwhereInput, XorderByInput, and maybe you were using these inputs into your code when you move from nexus-prisma-plugin to nexus-prisma you will not have these types exist anymore so you will get an error.

from nexus-prisma.

Frosty21 avatar Frosty21 commented on July 30, 2024

Can we close this issue @T-D3V or any update on this?
What do you define in your object types? @AhmedElywa is right this shouldn't be a bug its most likely you've define that object type more than once. comb through your code for a copy of name: '{model}' to find the one that is a duplicate.

from nexus-prisma.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.