From 8402200aa5f900b118b3cd117b3e7aecc00929b6 Mon Sep 17 00:00:00 2001 From: Chuck Driesler Date: Mon, 6 Dec 2021 23:28:30 -0500 Subject: [PATCH] disable download validation when debugging googleapis/google-cloud-node#654 --- api/src/gql/schema/graphs/resolvers/Query.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/api/src/gql/schema/graphs/resolvers/Query.ts b/api/src/gql/schema/graphs/resolvers/Query.ts index 7f4de0016..07212aff0 100644 --- a/api/src/gql/schema/graphs/resolvers/Query.ts +++ b/api/src/gql/schema/graphs/resolvers/Query.ts @@ -57,10 +57,12 @@ export const Query: BaseResolverMap = { }, } - // const bucket = admin.storage().bucket('np-graphs') - // const graphJsonPath = versionDocument.get('files.graphJson') - // const graphJsonFile = bucket.file(graphJsonPath) - // const [graphJson] = await graphJsonFile.download({ validation: false }) + const bucket = admin.storage().bucket('np-graphs') + const validation = process?.env?.DEBUG !== 'true' + + const graphJsonPath = versionDocument.get('files.graphJson') + const graphJsonFile = bucket.file(graphJsonPath) + const [graphJson] = await graphJsonFile.download({ validation }) return record },