fix: add explicit schema for hidden challenges
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
b197f73881
commit
64c969a908
@ -210,3 +210,41 @@ exports.onCreateBabelConfig = ({ actions }) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
};
|
||||||
|
Reference in New Issue
Block a user