Closed nafkhanzam closed 3 years ago
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 }];
},
};
how about for all models?
Here are all options https://paljs.com/generator#options-type-definition
module.exports = {
backend: {
generator: 'nexus',
disableQueries: true,
disableMutations: true,
},
};
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
If you already have any file generated our CLI will not remove it.
Here's the step that I did:
src/graphql/models
folder
pal.js
module.exports = {
backend: {
generator: "nexus",
output: "src/graphql/models",
disableQueries: true,
disableMutations: true,
},
};
pal g
Yes found it will fix and push new version
Please upgrade to the last version 2.5.5 and will get a fix for this issue
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"
},
...
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.
yeah, still having the issue.. how can I contact you? I dm'ed you via twitter..
Is there an option for creating nexus objectType model only, without queries and mutations? didn't seem to find one