GithubHelp home page GithubHelp logo

Comments (11)

AhmedElywa avatar AhmedElywa commented on May 18, 2024

Yes, there is one option to do this.

in your pal.js file, you can add this

example

module.exports = {
  backend: {
    generator: 'nexus',
    excludeModels: [{ name: "User", queries: true, mutations: true }];
  },
};

from prisma-tools.

nafkhanzam avatar nafkhanzam commented on May 18, 2024

how about for all models?

from prisma-tools.

AhmedElywa avatar AhmedElywa commented on May 18, 2024

Here are all options https://paljs.com/generator#options-type-definition

module.exports = {
  backend: {
    generator: 'nexus',
    disableQueries: true,
    disableMutations: true,
  },
};

from prisma-tools.

nafkhanzam avatar nafkhanzam commented on May 18, 2024

Here are all options https://paljs.com/generator#options-type-definition

module.exports = {
  backend: {
    generator: 'nexus',
    disableQueries: true,
    disableMutations: true,
  },
};

did exactly this and still generating both

from prisma-tools.

AhmedElywa avatar AhmedElywa commented on May 18, 2024

If you already have any file generated our CLI will not remove it.

from prisma-tools.

nafkhanzam avatar nafkhanzam commented on May 18, 2024

Here's the step that I did:

  1. delete src/graphql/models folder
    image
  2. write this in pal.js
module.exports = {
  backend: {
    generator: "nexus",
    output: "src/graphql/models",
    disableQueries: true,
    disableMutations: true,
  },
};
  1. run pal g
  2. here's the result
    image

from prisma-tools.

AhmedElywa avatar AhmedElywa commented on May 18, 2024

Yes found it will fix and push new version

from prisma-tools.

AhmedElywa avatar AhmedElywa commented on May 18, 2024

Please upgrade to the last version 2.5.5 and will get a fix for this issue

from prisma-tools.

nafkhanzam avatar nafkhanzam commented on May 18, 2024

Hmm, still having the exact same issue.. setting only disableQueries or disableMutations still generating both..
the excludeModels: [{name: "Doctor", queries: true, mutations: true}] works tho

pal.js

module.exports = {
  backend: {
    generator: "nexus",
    output: "src/graphql/models",
    disableQueries: true,
    disableMutations: true,
    excludeModels: [{name: "Doctor", queries: true, mutations: true}],
  },
};

package.json

...
"dependencies": {
    "@nexus/schema": "^0.17.0",
    "@paljs/cli": "^2.5.5",
    "@paljs/nexus": "^2.5.4",
    "@paljs/plugins": "^2.5.4",
    "@prisma/client": "2.10.1",
    "apollo-server-express": "^2.19.0",
    "axios": "^0.21.0",
    "bcrypt": "^5.0.0",
    "cross-env": "^7.0.2",
    "dotenv-flow": "^3.2.0",
    "express": "^4.17.1",
    "glob": "^7.1.6",
    "graphql": "^15.4.0",
    "graphql-request": "^3.3.0",
    "graphql-scalars": "^1.4.1",
    "graphql-tag": "^2.11.0",
    "jsonwebtoken": "^8.5.1",
    "link-module-alias": "^1.2.0",
    "moment": "^2.29.1",
    "nexus-plugin-prisma": "^0.23.1",
    "node-gcm": "^1.0.3",
    "nodemailer": "^6.4.14",
    "prisma-dbml-generator": "^0.3.1",
    "uuid": "^8.3.1",
    "winston": "^3.3.3",
    "winston-daily-rotate-file": "^4.5.0",
    "zod": "^1.11.10"
  },
...

from prisma-tools.

AhmedElywa avatar AhmedElywa commented on May 18, 2024

I just tested it 2.5.4 have issue 2.5.5 working good.

Please be sure you delete the folder and rerun it.

I can go online with you. If this does not work, please give it another try.

from prisma-tools.

nafkhanzam avatar nafkhanzam commented on May 18, 2024

yeah, still having the issue.. how can I contact you? I dm'ed you via twitter..

from prisma-tools.

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.