Como ficaria na nova versão? | Fórum | School of Net

Deseja poder participar de nosso fórum e tirar todas as suas dúvidas?
Clique aqui e assine nosso plano de acesso ilimitado. Saiba mais.

por JOAO MATHEUS

1 semana, 5 dias atrás JOAO MATHEUS

Como ficaria na nova versão?

Bom dia! Tentei atualizar o código para a nova versão mas sempre paro no erro abaixo: debugMessage: "Argument 1 passed to Rebing\GraphQL\Support\PaginationType::Rebing\GraphQL\Support\{closure}() must be an instance of Illuminate\Pagination\LengthAwarePaginator, instance of Illuminate\Database\Eloquent\Collection given, called in C:\Users\Usuario\Documents\6_Programacao\GraphQL\vendor\webonyx\graphql-php\src\Executor\ReferenceExecutor.php on line 632" extensions: {category: "internal"} category: "internal" locations: [{line: 3, column: 5}] message: "Internal server error" path: ["user_paginated", "current_page"] trace: [{,…}, {,…}, {,…}, {,…}, {,…}, {,…}, {,…}, {,…}, {,…}, {,…}, {,…}, {,…}, {,…},…] código: ``` public function resolve($root, $args, $context, ResolveInfo $resolveInfo, Closure $getSelectFields) { $paginate = 15; if(isset($args['paginate'])){ $paginate = $args['paginate']; } $page = 1; if(isset($args['page'])){ $page = $args['page']; } $fields = $getSelectFields(); $select = $fields->getSelect(); $with = $fields->getRelations(); $users = User::select($select)->with($with); return $users->get(); $fields = $getSelectFields(); $select = $fields->getSelect(); $with = $fields->getRelations(); return User::with($with)->paginate($paginate, ['*'], 'page', $page); //return User::select($select)->with($with)->paginate($paginate, ['*'], 'page', $page); } ```

1 Respostas