MongoDB objectId scalar for GraphQL.js
npm install graphql-objectid-scalar


Install it with
``bash`
npm install graphql-objectid-scalar
This package exports a mongodb GraphQLObjectId scalar :
`js`
import { GraphQLObjectId } from "graphql-objectid-scalar";
When using the SDL with GraphQL-tools, define GraphQLObjectId as the resolver for the appropriate scalar type in your schema:
`js
import { makeExecutableSchema } from "graphql-tools";
import { GraphQLObjectId } from "graphql-objectid-scalar";
const typeDefs =
scalar GraphQLObjectId
type MyType {
_id: GraphQLObjectId
}
;const resolvers = {
GraphQLObjectId: GraphQLObjectId
};
export default makeExecutableSchema({ typeDefs, resolvers });
``