Args vs variables in merge function

I’m trying to figure out the difference of args and variables in the merge function option object.

We tried to solve offset-limit-pagination with the offsetLimitPagination merge helper which didn’t work, so we implemented our own helper function. By doing that we figured out, that the args property of the option object is empty while there is a variables property from where we could read the offset and limit and came up with this helper:

(existing = [], incoming, options) => {
  const { offset } = options.variables;
  return [...existing.slice(0, offset), ...incoming];

The helper seems to work fine, but I was wondering if we did something wrong, that our offset and limit variables don’t show up in the args or if there is a bug in offsetLimitPagination and the documentation (where you are also supposed to read the offset / limit from the args property)

1 Like

We have the same issue. Evertighin seems to be in the variables. But why? According to this it should be available in the args.

Edit: Would be cool if someone knew the answer.