From c156742d87fcbead2da85ab504126e43dc9d9a9b Mon Sep 17 00:00:00 2001 From: Giancarlos Isasi Date: Tue, 5 Mar 2024 13:56:31 -0500 Subject: [PATCH] Docs: Fix generate-types syntax (#7832) This change fixes the typescript error in the example of splitting resolvers in multiple files. The `books` and `addBooks` must no be wrapped with a `Queries` or `Mutation` object. Wrong (screenshot taken from the official docs) ![image](https://github.com/apollographql/apollo-server/assets/17274950/8b002200-0c72-4556-b696-3b5956cc730a) Correct without `Queries` parent key (extracted from the working exampled linked at the end of the markdown file) ![image](https://github.com/apollographql/apollo-server/assets/17274950/6e9d167f-9215-4baf-8821-ceda407680e4) --- docs/source/workflow/generate-types.mdx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/source/workflow/generate-types.mdx b/docs/source/workflow/generate-types.mdx index 59ebf1192fd..18fc22fba8c 100644 --- a/docs/source/workflow/generate-types.mdx +++ b/docs/source/workflow/generate-types.mdx @@ -163,9 +163,7 @@ import { QueryResolvers } from '__generated__/resolvers-types'; // Use the generated `QueryResolvers` // type to type check our queries! const queries: QueryResolvers = { - Query: { // ...queries - }, }; export default queries; @@ -177,9 +175,7 @@ import { MutationResolvers } from '__generated__/resolvers-types'; // Use the generated `MutationResolvers` type // to type check our mutations! const mutations: MutationResolvers = { - Mutation: { - // ...mutations - }, + // ...mutations }; export default mutations;