1.0.10 • Published 3 years ago

@parameter1/graphql-type-month v1.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

GraphQL Month Type

A custom MongoDB Month GraphQL scalar type, which parses values in YYYY-MM format (e.g. 2021-03)

Installation

yarn add @parameter1/graphql-type-month

Usage

Add the custom scalar to your resolvers and pass any desired options.

// resolvers.js
const GraphQLMonth = require('@parameter1/graphql-type-month');

module.exports = {
  ObjectID: GraphQLMonth(),

  // your resovlers here...
};

And to your GraphQL type definitions.

scalar Month

Configuration

The default timezone is UTC. To change this, pass a timezone value as a resolver option. The value can be any timezone supported by the dayjs package.

// resolvers.js
const GraphQLMonth = require('@parameter1/graphql-type-month');

module.exports = {
  ObjectID: GraphQLMonth({ timezone: 'America/Chicago' }),

  // your resovlers here...
};
1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.2

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago