Skip to content

Pruanik/graphql_example_project

Repository files navigation

GraphQL Example Project

The project is an example of GraphQL API implementation using Symfony 5 framework and library GraphQLBundle (vendor Overblog). The project consists of four Docker containers (php, mysql, nginx, mongodb).

Installing the application

  1. Cloning the repository:

    [email protected]:Pruanik/graphql_example_project.git

  2. Configuring the .env file:

    cp .env_example .env

  3. Building containers:

    make build

  4. Starting containers

    make up

  5. Installing dependencies:

    make composer-install

  6. Running the migrations and filling the fixtures:

    make init

  7. Let's see the result:

    http://localhost:8080/

List of commands for project management

To build containers: make build

To install all composer dependencies: make composer-install

To start containers: make up

To start application containers if you have databases locally: up-without-databases

To run migrations and pour fixtures: make init

For stopping containers: make stop

To enter the main container with the application: make enter

Useful links

Application data model schema

Application Structure

  • GraphQL data schema are stored in config/graphql/types/Domain/Input and config/graphql/types/Domain/Object for mutations and objects.
  • In the migration folder, the actual migrations for starting the application.
  • The src/Document and src/Entity folders describe all entities for MongoDb and Mysql.
  • The src/GraphQL folder contains all custom classes for building GraphQL logic for our Symfony application.
  • src/Listener/ReferencesListener.php - is needed to configure relational links between entities stored in mysql and entities in MongoDb.
  • The src/Model folder contains all classes of our Symfony application.
  • src/Security/ApiTokenAuthenticator.php - here we implement a custom way to authenticate a user by the presence of a key in the request header.

Useful links




About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages