-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
keep a consistent naming GraphqlObjectId
- Loading branch information
1 parent
0dc6be4
commit 72649e3
Showing
1 changed file
with
9 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |