RestQL Data Resolution Package for Laravel

RestQL Data Resolution Package for Laravel

RestQL is a data resolution package for your Laravel models by Gregori Piñeres:

RestQL is a Laravel eloquent-based data resolution package. This package tries to adopt GraphQL principles solving only the data that the client requests. RestQL uses your Laravel models as an entry point to add queries to then based on the eloquent methods.

This package has data resolution clauses, which are a way to improve queries based on parameters provided by the client. It’s RESTful but uses principles from GraphQL.

From the project’s readme, here’s an example of the RestQL route:

use Restql\Restql;
use Illuminate\Http\Request;

// The RestQL endpoint.
Route::get('restql', function (Request $request) {
  return Restql::resolve($request);

And with that route, how you might use this package on the frontend to retrieve author names:

axios.get('', {
  params: {
    authors: {
      select: 'name'
}).then(({ data: authors }) => {
    // Do something...

Finally, you’d get the following JSON back:

  "authors": [
    { "id": 1, "name": "Kasey Yost" },
    { "id": 2, "name": "Ike Barton" },
    { "id": 3, "name": "Emie Daniel" },

Learn More

You can learn more about this package, get full installation instructions, and view the source code on GitHub at gregorip02/restql.

Filed in: News
Laravel News Partners

Laravel Jobs

Senior Full Stack Engineer - Laravel
Laravel partner seeks Lead Developer
Kirschbaum Development Group
Senior Programmer **Immediate Opening** (send resume to
SBG Corp
Web Developer - Laravel
Grand Forks, North Dakota
Center for Rural Health
Senior Full-Stack Laravel Developer
Berlin, Germany


Join 31,000+ others and never miss out on new tips, tutorials, and more.