apollo-datasource-mongodb
apollo-datasource-mongodb copied to clipboard
`deleteFromCacheByFields` fails when the query only uses one field
For example.
this.findByFields({
tag: new ObjectId('some-tag-id')
})
and
this.deleteFromCacheByFields({
tag: new ObjectId('some-tag-id')
})
generate different keys, for this case it will generate: {"tag":{"$oid":"6151e9b4b005977991064607"}} and {"tag":[{"$oid":"6151e9b4b005977991064607"}]} respectively; which will prevent the method from behaving correctly
the issue is generated here
The logic on https://github.com/GraphQLGuide/apollo-datasource-mongodb/blob/master/src/cache.js#L187-L200 basically needs to make its way into deleteFromCacheByFields() as that will make the keys match up.
Any progress on this?
Having the same issue
Addressed in 95