graphqltoolstypeint64
v2.0.2
Published
Int64 scalar type for [graphql-tools](https://github.com/apollographql/graphql-tools)
Downloads
4
Maintainers
Readme
graphql-tools-type-int64
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