From 7c990dfd8648b0b17ed88be3c9e9df15b97ec6a6 Mon Sep 17 00:00:00 2001 From: mottox2 Date: Thu, 19 Mar 2020 11:42:42 +0900 Subject: [PATCH] chore(gatsby): Convert built-in-types to typescript --- .../schema/types/{built-in-types.js => built-in-types.ts} | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) rename packages/gatsby/src/schema/types/{built-in-types.js => built-in-types.ts} (94%) diff --git a/packages/gatsby/src/schema/types/built-in-types.js b/packages/gatsby/src/schema/types/built-in-types.ts similarity index 94% rename from packages/gatsby/src/schema/types/built-in-types.js rename to packages/gatsby/src/schema/types/built-in-types.ts index dde7c19faccbd..f538d5a70461e 100644 --- a/packages/gatsby/src/schema/types/built-in-types.js +++ b/packages/gatsby/src/schema/types/built-in-types.ts @@ -1,4 +1,4 @@ -const { parse } = require(`graphql`) +import { parse, DocumentNode } from "graphql" const fileType = ` type File implements Node @infer { @@ -82,9 +82,5 @@ const sitePageType = ` } ` -const builtInTypeDefinitions = () => +export const builtInTypeDefinitions = (): DocumentNode[] => [fileType, directoryType, sitePageType].map(type => parse(type)) - -module.exports = { - builtInTypeDefinitions, -}