GithubHelp home page GithubHelp logo

Comments (12)

AhmedElywa avatar AhmedElywa commented on May 28, 2024

Hi @ScottWallace ,

You need to use one flag for js --js or --mjs not two
Try this please

@vitaliytv can you see this error in your pull need to make if pass two flags use one of them not two

from create-nexus-type.

ScottWallace avatar ScottWallace commented on May 28, 2024

No difference, same error.

from create-nexus-type.

AhmedElywa avatar AhmedElywa commented on May 28, 2024

ok this model here you share is made this error or the model with comment ?? can you show me how you write comments

from create-nexus-type.

ScottWallace avatar ScottWallace commented on May 28, 2024

I'm sorry if I wasn't clear. The error described is when I run the command npx cnt -mq -f -o --js in bash, against my schema.prisma file.

When I edit the schema.prisma file to remove the Comment and Mention models, cnt returns with Created files success, though, of course, the Comment and Mention models are absent.

Naturally, I could hand-create the missing Comment and Mention models, but that would strongly interfere with the development process. I'm hoping to use ctx as part of the build process.

I am not yet to a point where I can "write comments", because I need the nexus models created first, so that I can then use them in Apollo Server. None of my code, generated or otherwise, is being executed anywhere, I'm only attempting to use cnt to create the Nexus models from the Prisma2 schema.

from create-nexus-type.

ScottWallace avatar ScottWallace commented on May 28, 2024

Just to be more clear, cnt seems to process through the schema as far as the model Share, then fails, never creating the Comment or Mention files.

from create-nexus-type.

AhmedElywa avatar AhmedElywa commented on May 28, 2024

it's working very good and this out of

// Mention.js file
import nexus from 'nexus'
const { objectType, extendType } = nexus
					
export const Mention = objectType({
  name: 'Mention',
  definition(t) {
    t.model.id()
    t.model.ofUser()
    t.model.byUser()
    t.model.inPost()
    t.model.inComment()
    t.model.createdAt()
    t.model.updatedAt()
    t.model.deletedAt()
    t.model.deleted()
  },
})

export const mentionQuery = extendType({
  type: 'Query',
  definition(t) {
    t.crud.mention()
    t.crud.mentions({ filtering: true, ordering: true })
  },
})

export const mentionMutation = extendType({
  type: 'Mutation',
  definition(t) {
    t.crud.createOneMention()
    t.crud.updateOneMention()
    t.crud.upsertOneMention()
    t.crud.deleteOneMention()

    t.crud.updateManyMention()
    t.crud.deleteManyMention()
  },
})
// Comment.js
import nexus from 'nexus'
const { objectType, extendType } = nexus
					
export const Comment = objectType({
  name: 'Comment',
  definition(t) {
    t.model.id()
    t.model.body()
    t.model.pagerank()
    t.model.emotionalScore()
    t.model.author()
    t.model.post()
    t.model.links()
    t.model.hashtags()
    t.model.images()
    t.model.emotions()
    t.model.mentions()
    t.model.createdAt()
    t.model.updatedAt()
    t.model.deletedAt()
    t.model.deleted()
  },
})

export const commentQuery = extendType({
  type: 'Query',
  definition(t) {
    t.crud.comment()
    t.crud.comments({ filtering: true, ordering: true })
  },
})

export const commentMutation = extendType({
  type: 'Mutation',
  definition(t) {
    t.crud.createOneComment()
    t.crud.updateOneComment()
    t.crud.upsertOneComment()
    t.crud.deleteOneComment()

    t.crud.updateManyComment()
    t.crud.deleteManyComment()
  },
})

from create-nexus-type.

ScottWallace avatar ScottWallace commented on May 28, 2024

I wish that were the case for me. Here's some stats on my setup:

macOS: 10.15.2 (Catalina)
zsh shell (default for Catalina)
Node 10.17.0 via nvm
nvm 6.11.3
"nexus-prisma": "^0.7.0-next.1"
"@prisma/photon": "2.0.0-preview019"
"devDependencies": {
"create-nexus-type": "^1.1.3"
}

Don't know what else to try.

from create-nexus-type.

AhmedElywa avatar AhmedElywa commented on May 28, 2024

go here https://whereby.com/ahmedelywa to see your screen

from create-nexus-type.

ScottWallace avatar ScottWallace commented on May 28, 2024

Thanks for the offer, but I'm in a facility that prohibits such things.

from create-nexus-type.

AhmedElywa avatar AhmedElywa commented on May 28, 2024

added to my branch examples you can try with it
https://github.com/AhmedElywa/create-nexus-type/tree/master/examples/javascript

from create-nexus-type.

vitaliytv avatar vitaliytv commented on May 28, 2024

@vitaliytv can you see this error in your pull need to make if pass two flags use one of them not two

i don't see error

from create-nexus-type.

AhmedElywa avatar AhmedElywa commented on May 28, 2024

@vitaliytv
i get the error in this
image
add else for next if because you mess it and this add js export to mjs and ts

from create-nexus-type.

Related Issues (8)

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.