Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
crisu83 committed Feb 24, 2018
1 parent 31124d8 commit 6dfd17f
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,75 @@
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/digiaonline/graphql-php/master/LICENSE)

A PHP7 implementation of the [GraphQL specification](http://facebook.github.io/graphql/).

## Requirements

- PHP version >= 7.1

## Motivation

When we started developing this project there was two GraphQL implementations available for PHP developers; one from
[Webonyx](https://github.com/webonyx/graphql-php/) and one from [Youshido](https://github.com/youshido/graphql/).
Both of these had their own problems. The one from Webonyx is pretty much a direct port from the
[JavaScript implementation](https://github.com/graphql/graphql-js/) and includes a lot of things that we thought
should be provided as separate, optional libraries. The other implementation from Youshido was not a port and had some
neat ideas, but unfortunately it did not fulfill the GraphQL specification. In addition to this both of the libraries
were started quite a long time ago and are mainly developed by a single person (based on the commit log).
After looking into these alternatives, we knew that we could do better.

TODO

## Architecture

### Packages

#### Execution

Takes care of executing operation against a GraphQL schema.

**Package lead: [@hungneox](https://github.com/hungneox/)**

### Language

Defines the GraphQL language and the associated AST.

**Package lead: [@crisu83](https://github.com/crisu83/)**

#### Parsing

The plan is to encourage developers to use the official GraphQL parser written C++ through a PHP extension because
its performance is outstanding. However, we will also provide a shim for the parser, which allows developers to use
this library without installing a custom PHP extension in their environment.

The official GraphQL parser takes a GQL string as its input and returns the corresponding Abstract Syntax Tree (AST)
(an associative array in PHP) as its output. Most of the GraphQL implementations (across all languages) takes a
different approach where they convert the AST directly into nodes (class instances in PHP). While this approach might
be a bit faster, it couples the parser tightly with the rest of the library, which we think is short-sighted.
Instead we decided to take a different approach, where the parser produces the AST as an associative array. This allows
the developers to switch out the bundled parser for the parser written in C++ without changing a single line of code.

#### AST representation

We also believe that all libraries should be easy to extend so we decided to introduce a builder system using the
Builder pattern for converting the AST into nodes. This approach allows developers to implement their own builders if
the specification would change in the future, without changing a single line of code in this library.

### Type system

Describes the GraphQL type system and schema definition.

**Package lead: [@crisu83](https://github.com/crisu83/)**

TODO

## Usage

TODO

## Contributing

TODO

## License

See [LICENCE](LICENSE).

0 comments on commit 6dfd17f

Please sign in to comment.