Skip to content

Commit 45dcc9a

Browse files
committed
Expose sortBy in loadConfig allowlist
`loadConfig` builds its output from an explicit allowlist, so the new `sortBy` key from `config.default.yaml` was silently dropped. That made `siteMetadata.sortBy` undefined at build time, which in turn caused Gatsby's schema inference to omit the field — and the GraphQL query in `useConfigAndConceptSchemes` failed CI with `Cannot query field "sortBy" on type "SiteSiteMetadata"`. Add `sortBy` to the allowlist (default "prefLabel") and update the config snapshot test.
1 parent 1cf5d2d commit 45dcc9a

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

src/common.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ function loadConfig(configFile, defaultFile) {
144144
userConfig.searchableAttributes || defaults.searchableAttributes,
145145
customDomain: userConfig.custom_domain || "",
146146
failOnValidation: userConfig.fail_on_validation,
147+
sortBy: userConfig.sortBy || defaults.sortBy || "prefLabel",
147148
}
148149

149150
// check if all relevant colors are contained, otherwise use default colors

test/config.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ describe("Config Parsing", () => {
2727
},
2828
customDomain: "",
2929
failOnValidation: true,
30+
sortBy: "prefLabel",
3031
fonts: {
3132
regular: {
3233
font_family: "Aladin",

0 commit comments

Comments
 (0)