From cb0a0c6acb435ae77f2fff9a1202e17e9c361665 Mon Sep 17 00:00:00 2001 From: David Thyresson Date: Mon, 20 Feb 2023 14:18:06 -0500 Subject: [PATCH] how to genrate sdl --- 2023-02-20-mask-directive-demo/README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/2023-02-20-mask-directive-demo/README.md b/2023-02-20-mask-directive-demo/README.md index ce37a91c..dc24effc 100644 --- a/2023-02-20-mask-directive-demo/README.md +++ b/2023-02-20-mask-directive-demo/README.md @@ -6,6 +6,25 @@ Showcase the RedwoodJS Transformer directive to mask an email address -- with te 1. `yarn install` 1. `yarn rw prisma migrate dev` / or `yarn rw prisma migrate reset` to clear an re-seed. Seeds use Snaplet copycat. + +Note this repo already has the model and the service resolvers generated. + +1. Add model in api/db/schema.prisma + +``` +model Profile { + id Int @id @default(autoincrement()) + email String @unique + name String + birthday DateTime +} +``` + +1. Create the SDL, and CRUD service aka resolvers: +1. `yarn rw g sdl Profile --crud` + +Continued ... + 1. `yarn rw prisma studio` see Profile data 1. `yarn rw dev` launch dev server app 1. open `http://localhost:8911/graphql` for playground @@ -48,7 +67,7 @@ Showcase the RedwoodJS Transformer directive to mask an email address -- with te ``` 1. `yarn rw g directive maskedEmail` and pick Transformer or `yarn rw g directive maskedEmail --type transformer` -1. Implement directive and test. See code. +1. Implement directive and test. See code in `2023-02-20-mask-directive-demo/api/src/directives`. 1. `yarn rw test api` to test transform 1. Add directive to type