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

Releases: nuwave/laravel-graphql-relay

v0.3.4: Merge pull request #25 from hosmelq/master

17 Nov 13:58
Compare
Choose a tag to compare
Use getKey method instead of id

v0.3.3: Merge pull request #21 from davidstoker/add-root-value

27 Apr 23:08
Compare
Choose a tag to compare
Allow for passing rootValue

v0.3.2

25 Apr 14:35
Compare
Choose a tag to compare
v0.3.2 Pre-release
Pre-release
fix camel case config path

v0.3.1

22 Apr 20:27
Compare
Choose a tag to compare
v0.3.1 Pre-release
Pre-release
sanity check for query

v0.3.0: Merge pull request #10 from nuwave/develop

12 Mar 15:17
Compare
Choose a tag to compare
Merge develop branch

v0.2.0

27 Jan 13:57
Compare
Choose a tag to compare
v0.2.0 Pre-release
Pre-release
cleaned up config file

v0.1.6

25 Jan 02:13
Compare
Choose a tag to compare
v0.1.6 Pre-release
Pre-release
allow headers in mutation test trait

Dependency version bump

08 Jan 17:47
Compare
Choose a tag to compare
Pre-release
v0.1.5

dependency version bumped

Default resolver for connections

23 Nov 21:33
Compare
Choose a tag to compare
Pre-release

If no resolve method is set on a connection, the following function will be used:

function ($collection, array $args, ResolveInfo $info) use ($name) {
    $items = [];

    if ($collection instanceof Model) {
        $items = $collection->getAttribute($name);
    } else if (is_object($collection) && method_exists($collection, 'get')) {
        $items = $collection->get($name);
    } else if (is_array($collection) && isset($collection[$name])) {
        $items = new Collection($collection[$name]);
    }

    if (isset($args['first'])) {
        $total = $items->count();
        $first = $args['first'];
        $after = $this->decodeCursor($args);
        $currentPage = $first && $after ? floor(($first + $after) / $first) : 1;

        return new Paginator(
            $items->slice($after)->take($first),
            $total,
            $first,
            $currentPage
        );
    }

    return new Paginator(
        $items,
        count($items),
        count($items)
    );
}

Added mutation test helper

22 Nov 14:58
Compare
Choose a tag to compare
Pre-release

Helper trait that allows you to easily test mutations:

<?php

use Nuwave\Relay\Traits\MutationTestTrait;
use Illuminate\Foundation\Testing\DatabaseTransactions;

class CreateUserMutationTest extends TestCase
{
    use DatabaseTransactions, MutationTestTrait;

    /**
     * @test
     */
    public function itCanCreateANewUser()
    {
        $this->mutate('createUser', [
            'firstName'             => 'John',
            'lastName'              => 'Doe',
            'email'                 => 'john.doe@example.com',
            'password'              => 'foobar',
            'password_confirmation' => 'foobar'
        ])->seeJson([
            'firstName' => 'John',
            'lastName' => 'Doe'
        ]);
    }
}