1.0.0 • Published 2 years ago

graphql-type-object-id v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

built with typescript-lib-starter

graphql-type-object-id

MongoDB ObjectId scalar type for GraphQL.js.

## Installation

$ npm i graphql-type-object-id

Or

$ yarn add graphql-type-object-id

Usage

Import the type:

import GraphQLObjectId from 'graphql-type-object-id';

Or

import { GraphQLObjectId } from 'graphql-type-object-id';

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';

const typeDefs = `
  scalar ObjectId
  # ...
`;

const resolvers = {
  ObjectId: GraphQLObjectId,
};

export default makeExecutableSchema({ typeDefs, resolvers });

License

MIT

1.0.0

2 years ago

0.0.3

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.2

3 years ago