From f6a6e46a6169b9a077b04c4f4d7779c9788d3502 Mon Sep 17 00:00:00 2001 From: Alvin Crespo Date: Wed, 30 Sep 2020 09:53:04 -0400 Subject: [PATCH] fix: replace queryType with extendType (#65) Nexus will error out if a previous queryType is already defined. We're planning to include a "global" that sets this - so ensuring that generated modules just extend Query will ensure this error does not happen for a dev. --- template/_templates/graphql/new/graphql.ejs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/template/_templates/graphql/new/graphql.ejs b/template/_templates/graphql/new/graphql.ejs index b5796151..799b4fc2 100644 --- a/template/_templates/graphql/new/graphql.ejs +++ b/template/_templates/graphql/new/graphql.ejs @@ -27,7 +27,8 @@ export const CallPreference = enumType({ }); // Queries -schema.queryType({ +schema.extendType({ + type: 'Query', definition: (t) => { // List <%= plural %> Query (admin only) t.crud.<%= plural.toLowerCase() %>({