Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graphql-timezone

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-timezone

Timezone enum type for GraphQL

  • 2.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
836
increased by7.18%
Maintainers
1
Weekly downloads
 
Created
Source

GraphQL Timezone

Timezone scalar type for GraphQL.js.

Ex: Europe/Prague

Usage

This package exports a Timezone scalar GraphQL.js type and list of available timezones as array of strings and as enum as well:

import timezoneScalar, { timezones, Timezone } from 'graphql-timezone';

// Generate Timezone scalar
const Timezone = timezoneScalar();

// Generate Timezone with custom name and custom description
const CustomTimezone = timezoneScalar({
  name: 'CustomTimezone',
  description: 'Description of Custom Timezone scalar.'
});

// Get list of avaliable timezones
const listOfAvailableTimezones: string[] = timezones;

// Use Enum of generated timezones
const newTimezone = Timezone.EuropePrague // Points to "Europe/Prague"

Dependency

To list and validate the timezone, this library uses MomentTimezone.

Keywords

FAQs

Package last updated on 10 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc