graphql-currency-scalars

0.0.1 • Public • Published

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

/graphql-currency-scalars/

    Package Sidebar

    Install

    npm i graphql-currency-scalars

    Weekly Downloads

    608

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    103 kB

    Total Files

    12

    Last publish

    Collaborators

    • abhiaiyer