DISCLAIMER: This repo is for educational purposes.
This project acts as an example for setting up a GraphQL server via the overblog/graphql-bundle Composer PHP package. This is based on the PHP programming language and the Symfony full-stack framework.
You can watch my YouTube video tutorial, which explains how Overblog GraphQL bundle can be used and how your own GraphQL server implementations can be approached.
YouTube video URL: https://youtu.be/q9A7lVw-CKM
Makefile commands are supported by Bash and ZSH out-of-the-box. This project leverages Docker for having all dependencies (like correct PHP version) in place.
Make sure you have installed
Docker desktop upfront. Also a very first composer install
on your
host machine is necessary. Therefor you must have PHP and Composer installed on your host machine. There are lots of
tutorials online about having a basic local PHP and Composer setup. Google is your friend here.
- You must install all Composer packages initially via
composer install
on your host machine. Simply go to thesymfony
folder in your terminal and executecomposer install
. - Afterwards you'll be able to run the setup by executing
make container_run
- If everything worked as expected, Symfony greets you via your webbrowser on the following url:
http://localhost:8081
- You can query your GraphQL component endpoints via your preferrable GraphQL client. I do recommend the Altair GraphQL client.
- An example GraphQL query against the projects example GraphQL component is the following:
query Example {
example {
text
}
}
Exceute this query against the following endpoint: http://localhost:8081/graphql/
Notice: GraphQL does not only support queries. It also supports mutations (e.g. inserting data). Check examples in Overblog GraphQL package documentation: