GraphQL is a query language for your API, and a server-side runtime for executing queries by using a type system you define for your data. GraphQL isn't tied to any specific database or storage engine and is instead backed by your existing code and data.
Laravel is a web application framework PHP with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling.
cd laravel-graphql
php artisan serve
# http://localhost:8000/graphiql
cd laravel-graphql/client-application
npm run serve
# http://localhost:8081
{
user(id: 2) {
name
email
posts {
title
description
comments {
content
created_at
}
}
}
}
mutation {
createUser(
name: "Filipe Natanael",
email: "filipenatanael@example.com",
password: "MyPassWord#123"
) {
id
email
}
}
mutation {
createPost(
user_id: 2,
title: "JavaScript TDD",
description: "JavaScript TDD Course....."
) {
id
}
}