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';
|
2026-03-10 10:59:38 +01:00
|
|
|
// 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,
|
|
|
|
|
generates: {
|
|
|
|
|
'src/lib/graphql/generated/graphql.ts': {
|
|
|
|
|
plugins: ['typescript', 'typescript-operations'],
|
|
|
|
|
config: {
|
|
|
|
|
namingConvention: {
|
|
|
|
|
typeNames: 'change-case-all#pascalCase',
|
|
|
|
|
transformUnderscore: true,
|
|
|
|
|
},
|
2024-03-28 17:30:34 +01:00
|
|
|
scalars: {
|
|
|
|
|
LongString: 'string',
|
|
|
|
|
Cursor: 'string',
|
2025-09-18 22:27:19 +02:00
|
|
|
Duration: 'string',
|
2024-03-28 17:30:34 +01:00
|
|
|
},
|
2023-07-09 00:06:52 +02:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
'src/lib/graphql/generated/apollo-helpers.ts': {
|
|
|
|
|
plugins: ['typescript-apollo-client-helpers'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-10 10:59:38 +01:00
|
|
|
// eslint-disable-next-line import-x/no-default-export
|
2023-07-09 00:06:52 +02:00
|
|
|
export default config;
|