From 8350c517ccef4e15b151d5a2920c7af61bbb6f2f Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Tue, 18 Aug 2020 03:09:19 +0200 Subject: [PATCH] fix: revert explicit Gatsby schema (#39426) The Gatsby schema was breaking the React challenges (for some reason) this is a quick hotfix while I figure out what's going on. --- client/gatsby-node.js | 70 ++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/client/gatsby-node.js b/client/gatsby-node.js index 9aae9a774f..8d2a6e25fa 100644 --- a/client/gatsby-node.js +++ b/client/gatsby-node.js @@ -211,40 +211,42 @@ exports.onCreateBabelConfig = ({ actions }) => { }); }; +// TODO: this broke the React challenges, not sure why, but I'll investigate +// further and reimplement if it's possible and necessary (Oliver) // Typically the schema can be inferred, but not when some challenges are // skipped (at time of writing the Chinese only has responsive web design), so // this makes the missing fields explicit. -exports.createSchemaCustomization = ({ actions }) => { - const { createTypes } = actions; - const typeDefs = ` - type ChallengeNode implements Node { - question: Question - videoId: String - required: ExternalFile - files: ChallengeFile - } - type Question { - text: String - answers: [String] - solution: Int - } - type ChallengeFile { - indexhtml: FileContents - indexjs: FileContents - indexjsx: FileContents - } - type ExternalFile { - link: String - src: String - } - type FileContents { - key: String - ext: String - name: String - contents: String - head: String - tail: String - } - `; - createTypes(typeDefs); -}; +// exports.createSchemaCustomization = ({ actions }) => { +// const { createTypes } = actions; +// const typeDefs = ` +// type ChallengeNode implements Node { +// question: Question +// videoId: String +// required: ExternalFile +// files: ChallengeFile +// } +// type Question { +// text: String +// answers: [String] +// solution: Int +// } +// type ChallengeFile { +// indexhtml: FileContents +// indexjs: FileContents +// indexjsx: FileContents +// } +// type ExternalFile { +// link: String +// src: String +// } +// type FileContents { +// key: String +// ext: String +// name: String +// contents: String +// head: String +// tail: String +// } +// `; +// createTypes(typeDefs); +// };