Describe the bug
When i try to use directive paginator i got an error saying that directive does not exist.
type Query {
users: [User!]! @paginate
}

Expected behavior/Solution
It was not expected any error since a simple operation.
This problem happend because the paginator directive was moved from Nuwave\Lighthouse\Schema\Directives\
to Nuwave\Lighthouse\Pagination\
this first image it is a dump from the directive resolver and as the image shows it's pointing to the directive folders inside schema

this image shows the truth location of this file.

This is happend for others directive as well that was moved, like OrderBy and GlobalId.
Steps to reproduce
Schema::create('user', function (Blueprint $table) {
$table->id();
$table->string('name',255);
$table->string('email',255)->unique();
$table->string('password',1000);
$table->timestamps();
});
2.Create any model you want to and try to use paginator directive in your schema
<?php
namespace App\Models;
use Illuminate\Auth\Authenticatable;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Laravel\Lumen\Auth\Authorizable;
class User extends Model implements AuthenticatableContract, AuthorizableContract
{
use Authenticatable, Authorizable, HasFactory;
protected $table = 'user';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email',
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = [
'password',
];
}
type Query {
users: [User!]! @paginate
}
I am using lumen instead laravel
Lighthouse Version
Lighthouse 5.1
Lumen 8.0
PHP 8
Nginx
I had been getting same issue but i have fixed by registering PaginationServiceProvider in AppserviceProvider
$this->app->register(\Nuwave\Lighthouse\Pagination\PaginationServiceProvider::class);

@pkatuwal this actually worked, thank you.
I'll close this issue, but i think this is not good, maybe i will ask on slack why this solution, the directive resolver it's basicly guessing all possible paths, i think this could be better.
But still, thank you.
This is documented: https://lighthouse-php.com/master/getting-started/installation.html#lumen