-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1366 from danskernesdigitalebibliotek/develop
Release 2024.32.1
- Loading branch information
Showing
22 changed files
with
3,871 additions
and
1,125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,24 @@ | ||
overwrite: true | ||
schema: | ||
- "https://fbi-api.dbc.dk/${CODEGEN_SCHEMA_PROFILE}/graphql": | ||
headers: | ||
Authorization: "Bearer ${STORYBOOK_LIBRARY_TOKEN}" | ||
headers: | ||
Authorization: "Bearer ${STORYBOOK_LIBRARY_TOKEN}" | ||
documents: "src/**/*.graphql" | ||
generates: | ||
src/core/dbc-gateway/generated/graphql.tsx: | ||
config: | ||
fetcher: | ||
func: '../graphql-fetcher#fetcher' | ||
namingConvention: | ||
typeNames: change-case-all#pascalCase | ||
transformUnderscore: true | ||
func: "../graphql-fetcher#fetcher" | ||
namingConvention: "./scripts/dbc-gateway.codegen.naming" | ||
defaultScalarType: unknown | ||
plugins: | ||
- "typescript" | ||
- "typescript-operations" | ||
- "typescript-react-query" | ||
hooks: | ||
afterOneFileWrite: | ||
- yarn post-process-generated-graphql | ||
- yarn eslint --fix | ||
- yarn post-process-generated-graphql | ||
- yarn eslint --fix | ||
src/core/dbc-gateway/generated/graphql.schema.json: | ||
plugins: | ||
- "introspection" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* This file is used to convert the typescript symbols generated | ||
* by the graphql-codegen tool into pascal case. | ||
*/ | ||
|
||
// Todo: Find out to format this file correctly. Possibly as a ts file. | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
const { pascalCase } = require("change-case-all"); | ||
|
||
/** | ||
* This function is used to convert the typescript symbols to pascal case | ||
* Since the graphql schema is not consequent in naming, we need to fix some of the names. | ||
* | ||
* @param {string*} str | ||
* @return {string} | ||
*/ | ||
function PascalCaseMostly(str) { | ||
if (str === "moodSuggestResponse") { | ||
str = "MoodSuggestResponseElement"; | ||
} | ||
if (str === "ComplexSearchFacets") { | ||
str = "ComplexSearchFacetTypes"; | ||
} | ||
|
||
// If possible return the pascal case otherwise return the original string. | ||
return pascalCase(str) || str; | ||
} | ||
|
||
module.exports = PascalCaseMostly; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.