graphqltoolstypeint64

2.0.2 • Public • Published

graphql-tools-type-int64

Build Status Coverage Status

Int64 scalar type for graphql-tools

This is not actually 64-bit! Because javascript safe integers are between -(2^53 - 1) and 2^53 - 1, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger.

Usage

import { makeExecutableSchema } from 'graphql-tools'
// import Int64 from 'graphql-tools-type-int64'
import Int64 from 'graphqltoolstypeint64' // naming: because of npm spam detection
 
let typeDefs = [`
scalar Int64
type Query {
  value(v: Int64): Int64
}`
]
let resolvers = {
  Int64,
  Query: {
    value: (root, { v }) => v
  }
}
let schema = makeExecutableSchema({ typeDefs, resolvers })
 
export default schema

Package Sidebar

Install

npm i graphqltoolstypeint64

Weekly Downloads

10

Version

2.0.2

License

MIT

Unpacked Size

7.13 kB

Total Files

6

Last publish

Collaborators

  • up9cloud