Closed tedchsk closed 5 years ago
Hey @Teerapat12! So this is actually by design. The GraphQL ID encodes the type of the object, as well as the mongodb ID.
Does GraphQL have anyway of decoding the ID to become MongodbID?
I think I got it now. Thank you very much. :D
More questions. -So why does GraphQL need to encode the type of the object? -What is the advantage of this? -And if I have a mongoose UserId, how can I fetch that User but instead of mongoose, I use GraphQL instead? Or do I only have to use GraphQL
Thank you in advanced. I really want to master GraphQL. :D
(Why did I get the thumbsdown? What did I do wrong)
I am quite new to GraphQL, and I am quite confuse with the concept. My Mongoose ObjectId and GraphQL id is not the same. How can I use Id from Mongoose can find that Object through graphQL and vice versa? Or do I only have to create new field to link the two?
This is my mongoose schema.
const userSchema = new Schema({ name: String, email: String, password: String, permission_level: Number, validation_code : String, not_validate:Boolean, facebook : { id : String, token : String, email : String, name : String }, omise_cusid: String });