npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

graphql-temporal

v1.0.0

Published

Provides GraphQL scalars for JavaScript's new Temporal specification.

Downloads

448

Readme

graphql-temporal

Provides GraphQL scalars for JavaScript's new Temporal specification.

Install

You need a Temporal-compatible JavaScript environment or a polyfill to use this package.

You can find available polyfills here. See the test's polyfill for an installation example.

$ npm install graphql-temporal

Usage

Using graphql package:

import { GraphQLZonedDateTime } from "graphql-temporal";

const schema = new GraphQLSchema({
  ZonedDateTime: GraphQLZonedDateTime,
});

Using Apollo server:

import { GraphQLZonedDateTime } from "graphql-temporal";

const server = new ApolloServer({
  typeDefs: ["scalar ZonedDateTime"],
  resolvers: {
    ZonedDateTime: GraphQLZonedDateTime,
  },
});

Scalars

Instant

An Instant represents a fixed point in time (called "exact time"), without regard to calendar or location.

Maps to a Temporal.Instant in your resolvers.

Example serialized string: 2020-01-01T12:30:00Z

ZonedDateTime

A ZonedDateTime is a timezone-aware, calendar-aware date/time object that represents a real event that has happened (or will happen) at a particular exact time from the perspective of a particular region on Earth.

Maps to a Temporal.ZonedDateTime in your resolvers.

Example serialized string: 2020-01-01T12:30:00+10:00[Australia/Brisbane]

PlainDate

A PlainDate object represents a calendar date that is not associated with a particular time or time zone.

Maps to a Temporal.PlainDate in your resolvers.

Example serialized string: 2020-01-01

PlainTime

A PlainTime represents a wall-clock time, with a precision in nanoseconds, and without any time zone.

Maps to a Temporal.PlainTime in your resolvers.

Example serialized string: 12:30:00

PlainDateTime

A PlainDateTime represents a calendar date and wall-clock time that does not carry time zone information.

Maps to a Temporal.PlainDateTime in your resolvers.

Example serialized string: 2020-01-01T12:30:00

Duration

A Duration represents a duration of time which can be used in date/time arithmetic.

Maps to a Temporal.Duration in your resolvers.

Example serialized string: P2M