Skip to content

alphaolomi/laravel-graphql-api

Repository files navigation

🕸️ Laravel GraphQl Example

GraphQL Playground Screenshot

🛠️ Technologies

  • Laravel The PHP Framework for Web Artisans.
  • Lighthouse A Lighthouse is a GraphQL framework for Laravel.
  • GraphQL Playground A GraphQL Playground UI for testing and exploring GraphQL APIs.

🚀 Installation

Note: This project requires Git and Composer.

git clone

composer install

cp .env.example .env

php artisan key:generate

touch database/database.sqlite

php artisan migrate

php artisan db:seed

php artisan serve

Open http://localhost:8000/graphql-playground to view it in the browser.

📝 Usage

Queries

Here are some example queries to try:

{
    users {
        id
        name
        email
        posts {
            id
            title
            body
        }
    }
}
{
    user(id: 1) {
        id
        name
        email
        posts {
            id
            title
            body
        }
    }
}

🧪 Testing

php artisan test

⭐ Support for this project

If you liked this project, please give it a star ⭐ & check out my other projects.

📄 License

This project is open-sourced software licensed under the MIT license.