other
time

Time

Package nameWeekly DownloadsVersionLicenseUpdated
@graphql-codegen/time (opens in a new tab)DownloadsVersionLicenseDec 7th, 2022

Installation

Terminal
yarn 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;