fix(client): set custom schema
Necessary for the time being, as all the multi-file challenges are upcoming (and thus hidden)
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
078b06e462
commit
07cf7e3e72
@ -216,8 +216,34 @@ exports.onCreatePage = async ({ page, actions }) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.createSchemaCustomization = ({ actions }) => {
|
||||||
|
const { createTypes } = actions;
|
||||||
|
const typeDefs = `
|
||||||
|
type ChallengeNode implements Node {
|
||||||
|
files: ChallengeFile
|
||||||
|
}
|
||||||
|
type ChallengeFile {
|
||||||
|
indexcss: FileContents
|
||||||
|
indexhtml: FileContents
|
||||||
|
indexjs: FileContents
|
||||||
|
indexjsx: FileContents
|
||||||
|
}
|
||||||
|
type FileContents {
|
||||||
|
key: String
|
||||||
|
ext: String
|
||||||
|
name: String
|
||||||
|
contents: String
|
||||||
|
head: String
|
||||||
|
tail: String
|
||||||
|
editableRegionBoundaries: [Int]
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
createTypes(typeDefs);
|
||||||
|
};
|
||||||
|
|
||||||
// TODO: this broke the React challenges, not sure why, but I'll investigate
|
// TODO: this broke the React challenges, not sure why, but I'll investigate
|
||||||
// further and reimplement if it's possible and necessary (Oliver)
|
// further and reimplement if it's possible and necessary (Oliver)
|
||||||
|
// I'm still not sure why, but the above schema seems to work.
|
||||||
// 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.
|
||||||
|
Reference in New Issue
Block a user