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.
This commit is contained in:
Oliver Eyton-Williams
2020-08-18 03:09:19 +02:00
committed by GitHub
parent 6b3c61c737
commit 8350c517cc

View File

@ -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 // 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 // skipped (at time of writing the Chinese only has responsive web design), so
// this makes the missing fields explicit. // this makes the missing fields explicit.
exports.createSchemaCustomization = ({ actions }) => { // exports.createSchemaCustomization = ({ actions }) => {
const { createTypes } = actions; // const { createTypes } = actions;
const typeDefs = ` // const typeDefs = `
type ChallengeNode implements Node { // type ChallengeNode implements Node {
question: Question // question: Question
videoId: String // videoId: String
required: ExternalFile // required: ExternalFile
files: ChallengeFile // files: ChallengeFile
} // }
type Question { // type Question {
text: String // text: String
answers: [String] // answers: [String]
solution: Int // solution: Int
} // }
type ChallengeFile { // type ChallengeFile {
indexhtml: FileContents // indexhtml: FileContents
indexjs: FileContents // indexjs: FileContents
indexjsx: FileContents // indexjsx: FileContents
} // }
type ExternalFile { // type ExternalFile {
link: String // link: String
src: String // src: String
} // }
type FileContents { // type FileContents {
key: String // key: String
ext: String // ext: String
name: String // name: String
contents: String // contents: String
head: String // head: String
tail: String // tail: String
} // }
`; // `;
createTypes(typeDefs); // createTypes(typeDefs);
}; // };