If you have a model like this
"""
@model
@datasync
"""
type Comment {
id: ID!
text: String
description: String
}
And you attempt to add an document, a phantom field id is added to your document.
mutation {
updateComment(
input: {
id: "5ef49c9282b11580bbf2df47"
description: "changed"
updatedAt: "1593089170592"
}
) {
text
description
updatedAt
}
}
{
"_id" : ObjectId("5ef49c9282b11580bbf2df47"),
"text" : "comment",
"description" : "changed",
"noteId" : "5ef49c2682b11580bbf2df3c",
"_deleted" : false,
"createdAt" : 1593089170592,
"updatedAt" : 1593089915855,
"id" : "5ef49c9282b11580bbf2df47"
}
I think it could be coming from here https://github.com/aerogear/graphback/blob/master/packages/graphback-runtime-mongodb/src/MongoDBDataProvider.ts#L64 maybe we should strip it out from data before update?
/cc @wtrocki @craicoverflow @ssd71
This is duplicate of what @ssd71 is going to try solve. We have this mapping and this will go away
This is duplicate of what @ssd71 is going to try solve. We have this mapping and this will go away
Cool. Closing this in favour of https://github.com/aerogear/graphback/issues/1547 which has a good discussion around the general issue.
Most helpful comment
This is duplicate of what @ssd71 is going to try solve. We have this mapping and this will go away