Files
matrix-authentication-service/frontend/codegen.ts
T
Quentin Gliech ed4b6c42a7 Remove (C)
2024-09-10 14:28:55 +02:00

40 lines
1.1 KiB
TypeScript

// Copyright 2024 New Vector Ltd.
// Copyright 2023, 2024 The Matrix.org Foundation C.I.C.
//
// SPDX-License-Identifier: AGPL-3.0-only
// Please see LICENSE in the repository root for full details.
import { CodegenConfig } from "@graphql-codegen/cli";
// Adds a comment to the top of generated files to ignore linting and formatting
const lintIgnore = {
add: {
content: "/* prettier-ignore */\n/* eslint-disable */",
},
} as const;
const config: CodegenConfig = {
schema: "./schema.graphql",
documents: ["src/**/*.{tsx,ts}", "!src/gql/**/*"],
ignoreNoDocuments: true, // for better experience with the watcher
generates: {
"./src/gql/": {
preset: "client",
config: {
// By default, unknown scalars are generated as `any`. This is not ideal for catching potential bugs.
defaultScalarType: "unknown",
scalars: {
DateTime: "string",
Url: "string",
},
},
plugins: [lintIgnore],
},
"./src/gql/schema.ts": {
plugins: ["urql-introspection", lintIgnore],
},
},
};
export default config;