Skip to content
  • v4.0.1
  • 4fe8fcb
  • Compare
    Choose a tag to compare
    Search for a tag
  • v4.0.1
  • 4fe8fcb
  • Compare
    Choose a tag to compare
    Search for a tag

@moufmouf moufmouf released this Jan 13, 2020 · 7 commits to master since this release

Bugfix release

  • Fixing "a class declared with a bad namespace causes a crash" #216 #217 @moufmouf
    In particular this fixes problems with the Symfony bundle if the migrations directory is included in the "types" namespace

Improvements:

Assets 2
  • v4.0.0
  • 9aba230
  • Compare
    Choose a tag to compare
    Search for a tag
  • v4.0.0
  • 9aba230
  • Compare
    Choose a tag to compare
    Search for a tag

@moufmouf moufmouf released this Jan 8, 2020 · 16 commits to master since this release

This is a complete refactoring from 3.x. While existing annotations are kept compatible, the internals have completely
changed.

New features:

Many extension points have been added

  • Added a "root type mapper" (useful to map scalar types to PHP types or to add custom annotations related to resolvers)
  • Added "field middlewares" (useful to add middleware that modify the way GraphQL fields are handled)- Added a "parameter type mapper" (useful to add customize parameter resolution or add custom annotations related to parameters)

New framework specific features:

Symfony:

  • The Symfony bundle now provides a "login" and a "logout" mutation (and also a "me" query)

Laravel:

Internals:

  • The FieldsBuilder class has been split in many different services (FieldsBuilder, TypeHandler, and a
    chain of root type mappers)
  • The FieldsBuilderFactory class has been completely removed.
  • Overall, there is not much in common internally between 4.x and 3.x. 4.x is much more flexible with many more hook points
    than 3.x. Try it out!
Assets 2
  • v3.1.1
  • c04dfef
  • Compare
    Choose a tag to compare
    Search for a tag
  • v3.1.1
  • c04dfef
  • Compare
    Choose a tag to compare
    Search for a tag

@moufmouf moufmouf released this Oct 14, 2019

Improvements:

Assets 2

@moufmouf moufmouf released this Oct 14, 2019 · 11 commits to 3.1 since this release

New feature:

Assets 2
  • v3.0.1
  • 8711488
  • Compare
    Choose a tag to compare
    Search for a tag
  • v3.0.1
  • 8711488
  • Compare
    Choose a tag to compare
    Search for a tag

@moufmouf moufmouf released this Sep 5, 2019 · 4 commits to 3.0 since this release

Improvement:

  • Looking for annotations only in public methods #128
Assets 2
  • v3.0.0
  • 1fa0023
  • Compare
    Choose a tag to compare
    Search for a tag
  • v3.0.0
  • 1fa0023
  • Compare
    Choose a tag to compare
    Search for a tag

@moufmouf moufmouf released this Apr 26, 2019 · 428 commits to master since this release

First stable release of GraphQLite

GraphQLite is PHP library that allows you to write your GraphQL queries in simple-to-write controllers.

  • Create a complete GraphQL API by simply annotating your PHP classes
  • Framework agnostic, but Symfony and Laravel bindings available!
  • Comes with batteries included: queries, mutations, mapping of arrays / iterators, file uploads, extendable types and more!

After several months of work, we are very happy to announce the availability of GraphQLite v3.0.

If you are wondering where are v1 and v2... yeah... GraphQLite is a fork of "thecodingmachine/graphql-controllers" that already had a v1 and a v2. But so much has changed that it deserved a new name!

Check out the documentation

Basic example

First, declare a query in your controller:

class ProductController
{
    /**
     * @Query()
     */
    public function product(string $id): Product
    {
        // Some code that looks for a product and returns it.
    }
}

Then, annotate the Product class to declare what fields are exposed to the GraphQL API:

/**
 * @Type()
 */
class Product
{
    /**
     * @Field()
     */
    public function getName(): string
    {
        return $this->name;
    }
    // ...
}

That's it, you're good to go 🎉! Query and enjoy!

{
  product(id: 42) {
    name
  }
}
Assets 2
You can’t perform that action at this time.