From 19e3ea5df4740fe8a2f77f1639827428abe9d717 Mon Sep 17 00:00:00 2001 From: Simon Gagnon Date: Sun, 6 Nov 2022 13:56:47 -0500 Subject: [PATCH] [Tutorial]: Fix Typescript code blocks inconsistency (#6801) * fix doc inconsistency * update type for createContact exemple --- docs/docs/tutorial/chapter3/saving-data.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/docs/tutorial/chapter3/saving-data.md b/docs/docs/tutorial/chapter3/saving-data.md index 3512b86b25c1..3bcd7386d234 100644 --- a/docs/docs/tutorial/chapter3/saving-data.md +++ b/docs/docs/tutorial/chapter3/saving-data.md @@ -298,9 +298,10 @@ export const deleteContact = ({ id }) => { ```js title="api/src/services/contacts/contacts.ts" -import { db } from 'src/lib/db' import type { QueryResolvers, MutationResolvers } from 'types/graphql' +import { db } from 'src/lib/db' + export const contacts: QueryResolvers['contacts'] = () => { return db.contact.findMany() } @@ -1280,14 +1281,14 @@ export const createContact = ({ input }) => { ```ts title="api/src/services/contacts/contacts.ts" -import type { Prisma } from '@prisma/client' +import type { QueryResolvers, MutationResolvers } from 'types/graphql' // highlight-next-line import { validate } from '@redwoodjs/api' // ... -export const createContact = ({ input }: CreateContactArgs) => { +export const createContact = ({ input }: MutationResolvers['createContact']) => { // highlight-next-line validate(input.email, 'email', { email: true }) return db.contact.create({ data: input })