Closed martineboh closed 4 years ago
If you using pal.json you need to pass his name to pal g
command like pal g -c pal.json
if you using pal.js
so you can use pal g
without any custom flags in the command
Also, you not provided any errors message that sees what is wrong with you to help you
Thanks for responding so quickly. It doesn't show any error, just displayed Generating your files in just a second. I am using pal.js
with content:
!!! - I am not using TS.
module.exports = {
schemaFolder: '/prisma',
backend: {
models: ['Profile', 'Senator'],
generator: 'sdl',
onDelete: true,
excludeQueriesAndMutations: ['aggregate']
}
};
I ran pal g
in the root directory - it generated src/graphql
folder with the wrong Models: Course
, Group
, Post
, Product
, User
...with their corresponding typeDefs
and resolvers.ts
that are not in my schema.prisma
file.
PS: Also how do I use the below with the Option
args:
import { Generator } from '@paljs/generator';
import { generateGraphQlSDLFile } from '@paljs/plugins';
import typeDefs from './graphql/typeDefs';
import resolvers from './graphql/resolvers';
let schema = makeExecutableSchema({ typeDefs, resolvers });
// Build one sdl file have all types you can delete if you not need
generateGraphQlSDLFile(schema);
Talk to me in Prisma slack
So the problem you need to run prisma generate
command first before pal g
command
Thanks for your work!
I find it really hard to use
prisma-tools
because enough example code isn't provided, just bunch of interfaces. I have been trying to generate SDL from myschema.prisma
file for days now with no success usingpal g
command, even after creating pal.json in my root directory with schema.prisma in the prisma directory relative to root.