Files
suwayomi-material-you-webui/gql_codegen.ts

51 lines
1.6 KiB
TypeScript
Raw Normal View History

2023-07-09 00:06:52 +02:00
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import type { CodegenConfig } from '@graphql-codegen/cli';
// eslint-disable-next-line import-x/no-extraneous-dependencies
2025-08-02 23:13:50 +02:00
import 'dotenv/config';
2023-07-09 00:06:52 +02:00
const config: CodegenConfig = {
overwrite: true,
2025-08-02 23:13:50 +02:00
schema: process.env.CODEGEN_SERVER_URL_GQL,
2025-12-22 14:00:44 +01:00
documents: ['src/lib/graphql/**', '!src/lib/graphql/generated/**'],
2023-07-09 00:06:52 +02:00
ignoreNoDocuments: true,
2026-05-15 20:40:31 +02:00
config: {
namingConvention: {
typeNames: 'change-case-all#pascalCase',
transformUnderscore: true,
},
scalars: {
LongString: 'string',
Cursor: 'string',
Duration: 'string',
},
},
2023-07-09 00:06:52 +02:00
generates: {
2026-05-15 20:40:31 +02:00
'src/lib/graphql/generated/graphql-base.types.ts': {
plugins: ['typescript'],
config: {
generateOperationTypes: false,
},
},
2023-07-09 00:06:52 +02:00
'src/lib/graphql/generated/graphql.ts': {
2026-05-15 20:40:31 +02:00
plugins: ['typescript-operations'],
2023-07-09 00:06:52 +02:00
config: {
2026-05-15 20:40:31 +02:00
importSchemaTypesFrom: 'src/lib/graphql/generated/graphql-base.types.ts',
nonOptionalTypename: true,
2023-07-09 00:06:52 +02:00
},
},
'src/lib/graphql/generated/apollo-helpers.ts': {
plugins: ['typescript-apollo-client-helpers'],
},
},
};
// eslint-disable-next-line import-x/no-default-export
2023-07-09 00:06:52 +02:00
export default config;