Skip to content

Commit

Permalink
keep a consistent naming GraphqlObjectId
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-burel committed Jun 20, 2022
1 parent 0dc6be4 commit 72649e3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/mongo-apollo/objectIdScalar.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
// @see https://github.com/CaptorAB/graphql-objectid-scalar
import { GraphQLObjectId } from "graphql-objectid-scalar";

/**
* GraphQL type for a Mongo ObjectId
*
* Use as "typeName" in your Vulcan schema for _id, userId, or any field with relations via ids
*/
export const GraphqlObjectId = "GraphQLObjectId";

/**
* NOTE: the type is ObjectID to be consistent with GraphQL "ID" type
* Be careful with the casing
*/
export const objectIdTypeDefs = `scalar GraphQLObjectId`;
export const objectIdTypeDefs = `scalar ${GraphqlObjectId}`;

export const objectIdResolvers = {
ObjectId: GraphQLObjectId,
GraphQLObjectId,
};

/**
* GraphQL type for a Mongo ObjectId
*/
export const GraphqlObjectId = "GraphQLObjectId";

0 comments on commit 72649e3

Please sign in to comment.