From 8ec5b1165394b19241d437ac31fd9f71e95ef3d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Wed, 27 Mar 2019 21:34:48 +0100 Subject: [PATCH] Fix babel initialization for graphql type generation (#33962) This restores the functionality of the graphql type generation scripts after #33093. In particular, it properly sets up the babel import hook so schemata can once more be imported from `.ts/.tsx` files. --- x-pack/plugins/infra/scripts/generate_types_from_graphql.js | 2 ++ x-pack/plugins/uptime/scripts/infer_graphql_types.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/x-pack/plugins/infra/scripts/generate_types_from_graphql.js b/x-pack/plugins/infra/scripts/generate_types_from_graphql.js index caeb73c3bf797c..aec5ff6da99ce6 100644 --- a/x-pack/plugins/infra/scripts/generate_types_from_graphql.js +++ b/x-pack/plugins/infra/scripts/generate_types_from_graphql.js @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +require('../../../../src/setup_node_env'); + const { join, resolve } = require('path'); // eslint-disable-next-line import/no-extraneous-dependencies, import/no-unresolved const { generate } = require('graphql-code-generator'); diff --git a/x-pack/plugins/uptime/scripts/infer_graphql_types.js b/x-pack/plugins/uptime/scripts/infer_graphql_types.js index 104fd5b66b5d6b..b821fbde4084ef 100644 --- a/x-pack/plugins/uptime/scripts/infer_graphql_types.js +++ b/x-pack/plugins/uptime/scripts/infer_graphql_types.js @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +require('../../../../src/setup_node_env'); + const { resolve } = require('path'); // eslint-disable-next-line import/no-extraneous-dependencies, import/no-unresolved const { generate } = require('graphql-code-generator');