Socket
Socket
Sign inDemoInstall

graphql-currency-scalars

Package Overview
Dependencies
6
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    graphql-currency-scalars

GraphQL Scalars for formatting Currency


Version published
Weekly downloads
2K
increased by343.45%
Maintainers
1
Install size
113 kB
Created
Weekly downloads
 

Readme

Source

graphql-currency-scalars

Installation

yarn add graphql-currency-scalars

Usage

To use these scalars you'll need to add them in two places, your schema and your resolvers map.

In your schema:

scalar USCurrency

In your resolver map, first import them:

import {
  USCurrency
} from 'graphql-currency-scalars';

Then make sure they're in the root resolver map like this:

const myResolverMap = {
  USCurrency,

  Query: {},

  Mutation: {},
};

USCurrency

Format us cents into a fixed dollar amount.

1000 cents would become $10.00

FAQs

Last updated on 29 Mar 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc