1.0.5 • Published 2 years ago

graphql-objectid-scalar v1.0.5

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

CircleCI npm version install size

graphql-objectid-scalar

Usage

Install it with

npm install graphql-objectid-scalar

This package exports a mongodb GraphQLObjectId scalar :

import { GraphQLObjectId } from "graphql-objectid-scalar";

SDL with GraphQL-tools

When using the SDL with GraphQL-tools, define GraphQLObjectId as the resolver for the appropriate scalar type in your schema:

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 });
1.0.5

2 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago