Time
Plugin for time. This plugin is used to get the current time.
- Package
- @graphql-codegen/time
- Version
- 8.0.0
- Weekly downloads
- 13k
- License
- MIT
- Updated
- Nov 7, 2026
Installation
npm i -D @graphql-codegen/time
yarn add -D @graphql-codegen/time
pnpm add -D @graphql-codegen/time
bun add -D @graphql-codegen/time
Config API Reference
format
type: string
Customize the Moment format of the output time. Default value: “YYYY-MM-DDTHH:mm:ssZ”
Usage Examples
import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
schema: 'https://localhost:4000/graphql',
documents: ['src/**\/*.tsx'],
generates: {
'path/to/file.ts': {
plugins: ['time'],
config: {
format: 'DD.MM.YY'
},
},
},
};
export default config;
message
type: string
Customize the comment message Default value: “‘Generated on’”
Usage Examples
import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
schema: 'https://localhost:4000/graphql',
documents: ['src/**\/*.tsx'],
generates: {
'path/to/file.ts': {
plugins: ['time'],
config: {
message: 'The file generated on: '
},
},
},
};
export default config;