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

1.1.2 • 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

12

Version

1.1.2

License

MIT

Unpacked Size

5.38 kB

Total Files

7

Last publish

Collaborators

  • dinels