graphql-type-object-id-no-deps
v1.1.2
Published
Very flexible low-deps Graphql ObjectID Scalar for NestJS
Downloads
17
Maintainers
Readme
graphql-type-object-id-no-deps
MongoDB ObjectId scalar type for GraphQL.js.
## Installation
$ npm i graphql-type-object-id-no-deps
Or
$ yarn add graphql-type-object-id-no-deps
Usage
Import the type:
import GraphQLObjectId from 'graphql-type-object-id-no-deps';
Or
import { GraphQLObjectId } from 'graphql-type-object-id-no-deps';
In your schema
You can use this in a programmatically-constructed schema as with any other scalar type:
import { makeExecutableSchema } from '@graphql-tools/schema';
import GraphQLObjectId from 'graphql-type-object-id-no-deps';
const typeDefs = `
scalar ObjectId
# ...
`;
const resolvers = {
ObjectId: GraphQLObjectId,
};
export default makeExecutableSchema({ typeDefs, resolvers });
License
MIT