cult-of-coders / grapher

Grapher: Meteor Collection Joins + Reactive GraphQL like queries
https://atmospherejs.com/cultofcoders/grapher
MIT License
275 stars 53 forks source link

[BUG] Collection.hasLink('toString') === true #414

Open MaxmaxmaximusGitHub opened 4 years ago

MaxmaxmaximusGitHub commented 4 years ago
Messages = new Mongo.Collection('messages')

Messages.addLinks({
    'user': {
        type      : 'one',
        collection: Meteor.users,
        field     : 'userId',
    }
})

console.log Messages.hasLink('toString') // true
copleykj commented 4 years ago

While I guess this is technically a bug, I'm not sure how you possibly stumbled across this :joy:

Prinzhorn commented 3 years ago

https://github.com/cult-of-coders/grapher/blob/842dbb1ed313ecd1abdd7fc79378be673445df1b/lib/links/extension.js#L46

use hasOwnProperty (in multiple other places as well)