disable graphiql on production
Do you mean to enable graphiql on development only and disable it on production. If so just exclude the /graphiql handler
if (process.env.NODE_ENV === 'development') {
app.all(
'/graphiql',
graphiqlExpress({
endpointURL: '/graphql',
}),
);
}