prisma-appsync icon indicating copy to clipboard operation
prisma-appsync copied to clipboard

Generator for v2

Open cipriancaba opened this issue 3 years ago • 3 comments

Great job on the library, your approach makes the most sense from all the research I've done

I saw the progress on the next version which looks really great, was wondering if there's a generator we can use with the preview version eg yarn create prisma-appsync-app@preview

Only thing I'm missing is the cdk boilerplate, but I assume I can just use the one from the dev branch?

cipriancaba avatar Aug 26 '22 14:08 cipriancaba

Thanks @cipriancaba! The next version is close to being released. I’m planning on finalising the remaining tasks and documentation writing after I am back from my current holiday.

At this stage, there is no preview command you can use to automate installation - however, you can clone the maoosi/dev branch (most up to date) and manually copy files from inside the packages/boilerplate directory - which include a CDK file (using aws-cdk v2).

maoosi avatar Aug 28 '22 13:08 maoosi

Makes sense, that's what I was planning to do.. Thanks for the hard work and enjoy your holiday

On an unrelated note, is there an option to allow for opt-in generation of crud endpoints os opposed to opt-out? As in, don't want all the models to have cruds, just some of them

cipriancaba avatar Aug 29 '22 10:08 cipriancaba

Using the new coming version, you'll be able to do the following from your Prisma schema file:

/// @gql(queries: null, mutations: null, subscriptions: null)
model Post {
  id       Int       @id @default(autoincrement())
  title    String
}

Or tweak the output using something like:

/// @gql(queries: { list: 'posts' }, subscriptions: null)
model Post {
  id       Int       @id @default(autoincrement())
  title    String
}

maoosi avatar Aug 29 '22 10:08 maoosi

This was incredibly helpful, using v2 with great success. Amazing job

cipriancaba avatar Sep 20 '22 15:09 cipriancaba