@tadashi/gql-scalar-date
v1.0.0
Published
Date custom scalar type - GraphQL
Downloads
2
Readme
gql-scalar-date
Date custom scalar type - GraphQL
Install
$ npm i -S @tadashi/gql-scalar-date
Usage
import {
GraphQLSchema,
GraphQLObjectType,
} from 'graphql'
import GraphQLDateScalar from '@tadashi/gql-scalar-date'
const schema = new GraphQLSchema({
query: new GraphQLObjectType({
name: 'RootQueryType',
fields: {
now: {
type: GraphQLDateScalar,
resolve() {
return new Date()
},
},
},
}),
})
License
MIT © Thiago Lagden