graphql-moment
GraphQL Moment Date Type
Last updated 4 years ago by jiexi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install graphql-moment 
SYNC missed versions from official npm registry.

graphql-moment Build Status

GraphQL Moment Date Type

Installation

npm i --save graphql-moment

Usage

var {Factory, GraphQLDate} = require('graphql-moment')

// Use graphql-moment in your GraphQL objects for Date properties
var fooType = new GraphQLObjectType({
  name: 'Foo',
  description: 'Some foo type',
  fields: {
    created: {
      type: GraphQLDate, // defaults to standard ISO 8601 date format
      description: 'Date foo was created'
    }
  }
});

var fooType = new GraphQLObjectType({
  name: 'Foo',
  description: 'Some foo type',
  fields: {
    created: {
      type: GraphQLDate, // defaults to standard ISO 8601 date format
      description: 'Date foo was created'
    }
  }
});

Built-in date formats

GraphQLDate // Standard ISO 8601
GraphQLUnixTime // Milliseconds since 1970-01-01 UTC
GraphQLMMDDYYYY // MM-DD-YYYY format
GraphQLYYYYMMDD // YYYY-MM-DD format

Custom date formats

GraphQLTime = Factory('h:mm:ss', 'Time')
GraphQLEmit = Factory('ss:mm:h', 'Emit')

License

MIT

Based on

https://github.com/tjmehta/graphql-date

Current Tags

  • 0.0.2                                ...           latest (4 years ago)

2 Versions

  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |