Eager-load and pagination
with is just another query param, like limit or whatever parameters you’re defining in entryParams.

The {% paginate %} tag requires that you pass in an ElementCriteriaModel, but as soon as you call find() you’re actually dealing with an array of the matched entries.

So the key to getting eager-loading working with pagination is to assign the with param like any other param, rather than passing it into the find() function.

{% set queryParams = {
    // ...
    with: [
        'gridMatrixBlock1:rowItem1',
        ['gridMatrixBlock1:rowItem1.gridimageFile', {
            kind: 'image',
            withTransforms: projectThumb
        }],
        ...
    ]
} %}


and then you can create your ElementCriteriaModel just like you were doing before:

{% set allProjects = craft.entries(queryParams).limit(itemsPerPage) %}