Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Scout pagination arguments #661

Merged
merged 3 commits into from Mar 12, 2019
Merged

Handle Scout pagination arguments #661

merged 3 commits into from Mar 12, 2019

Conversation

fredmarmillod
Copy link
Contributor

  • Added or updated tests
  • Added Docs for all relevant versions

Related Issue/Intent

Resolves #592

Changes

// Nuwave\Lighthouse\Schema\Directives\Fields\PaginateDirective

protected function getPaginatedResults(array $resolveArgs, int $page, int $first): LengthAwarePaginator
{
    ...

    if ($query instanceof \Laravel\Scout\Builder) {
        return $query->paginate($first, 'page', $page);
    }

    return $query->paginate($first, ['*'], 'page', $page);
}

Please review my test case, it could be simpler I think.

@spawnia spawnia merged commit 1e341d4 into nuwave:master Mar 12, 2019
@spawnia
Copy link
Collaborator

spawnia commented Mar 12, 2019

Great job on this @xahs

Thanks!

@fredmarmillod fredmarmillod deleted the fix-scout-search-with-pagination branch March 12, 2019 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to use @search directive with scopes
3 participants