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
// 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);
// };