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 97a0cd3
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,73 @@
[![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/).
The one from Webonyx is a direct port of the reference implementation and it includes a lot of things that we thought
should be provided as separate libraries. The other implementation from Youshido has some neat ideas, but unfortunately
it does not fulfill the GraphQL specification. After doing some research, we concluded that neither of these
implementations met our needs, so we decided to start writing some code and see if 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 97a0cd3

Please sign in to comment.