mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
* Add types to graphql scalars * Upgrade dependencies * Override UI config type * Remove all IUIConfig casts * Add tableColumns to IUIConfig * Add BoolMap type, set strictScalars * Add PluginConfigMap * Replace any with unknown * Add SavedObjectFilter and SavedUIOptions * Remove unused items from CriterionType
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import type { CodegenConfig } from "@graphql-codegen/cli";
|
|
|
|
const config: CodegenConfig = {
|
|
schema: [
|
|
"../../graphql/schema/**/*.graphql",
|
|
"graphql/client-schema.graphql",
|
|
],
|
|
config: {
|
|
// makes conflicting fields override rather than error
|
|
onFieldTypeConflict: (_existing: unknown, other: unknown) => other,
|
|
},
|
|
documents: "graphql/**/*.graphql",
|
|
generates: {
|
|
"src/core/generated-graphql.ts": {
|
|
plugins: [
|
|
"time",
|
|
"typescript",
|
|
"typescript-operations",
|
|
"typescript-react-apollo",
|
|
],
|
|
config: {
|
|
strictScalars: true,
|
|
scalars: {
|
|
Time: "string",
|
|
Timestamp: "string",
|
|
Map: "{ [key: string]: unknown }",
|
|
BoolMap: "{ [key: string]: boolean }",
|
|
PluginConfigMap: "{ [id: string]: { [key: string]: unknown } }",
|
|
Any: "unknown",
|
|
Int64: "number",
|
|
Upload: "File",
|
|
UIConfig: "src/core/config#IUIConfig",
|
|
SavedObjectFilter: "src/models/list-filter/types#SavedObjectFilter",
|
|
SavedUIOptions: "src/models/list-filter/types#SavedUIOptions",
|
|
},
|
|
withRefetchFn: true,
|
|
},
|
|
},
|
|
},
|
|
};
|
|
|
|
export default config;
|