other
time

Time

Package nameWeekly DownloadsVersionLicenseUpdated
@graphql-codegen/time (opens in a new tab)DownloadsVersionLicenseMay 24th, 2023

Installation

pnpm add -D @graphql-codegen/time

Config API Reference

format

type: string default: YYYY-MM-DDTHH:mm:ssZ

Customize the Moment format of the output time.

Usage Examples

codegen.ts
 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 default: 'Generated on'

Customize the comment message

Usage Examples

codegen.ts
 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;