Skip to content

abhiaiyer91/graphql-currency-scalars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Format Currency in your GraphQL servers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published