graphql-type-object-id-no-deps
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

built with typescript-lib-starter

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

Package Sidebar

Install

npm i graphql-type-object-id-no-deps

Weekly Downloads

8

Version

1.0.0

License

MIT

Unpacked Size

5.52 kB

Total Files

7

Last publish

Collaborators

  • dinels