From 7df8903762645b346f80ca1c95232c4b2549d7f9 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Fri, 27 Dec 2024 13:41:20 -0800 Subject: [PATCH] disable introspection when environment is set to production --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 21077cf..170054d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,7 +12,8 @@ const typeDefs = readFileSync("./schema.graphqls", "utf8"); async function main() { const server = new ApolloServer({ typeDefs, - resolvers + resolvers, + introspection: process.env.NODE_ENV !== "production", }); const repository = new UnoptimizedInMemoryRepository();