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

Limit & skip not working correctly for many links #431

Closed SandroMueller closed 4 years ago

SandroMueller commented 4 years ago

I want to limit and skip a linked field of type many (profiles) as follows:

export default Trades.createQuery('oneTrade', {
    name: 1,
    profiles: {
        title: 1,
        shortDescription: 1,
        $filter({filters, options, params}) {
            options.limit = 5;
            options.skip = 2;
        },
    }
});

Unfortunately, this code does not skip the first 5 profiles. The number of results of the profiles is limited to 5 and then only the first two results are removed from the output. So the skipping doesn't work. Here a little example:

I have 10 profiles. I would like to have the profiles 3-7 in the output object. In my opinion, that should work with the code above. But with the code above, I get the profiles 3-5 (the skipping does not skip but wrongly removes profiles 1&2).

I hope someone can help me.