Skip to content

Commit d4b12bc

Browse files
author
Mikk Mihkel Nurges
committed
Merge branch 'master' into develop
2 parents 074ac35 + b13d490 commit d4b12bc

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

Readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
[![Latest Stable Version](https://poser.pugx.org/rebing/graphql-laravel/v/stable)](https://packagist.org/packages/rebing/graphql-laravel)
44
[![License](https://poser.pugx.org/rebing/graphql-laravel/license)](https://packagist.org/packages/rebing/graphql-laravel)
5+
[![Get on Slack](https://img.shields.io/badge/slack-join-orange.svg)](https://join.slack.com/t/rebing-graphql/shared_invite/enQtNTE5NjQzNDI5MzQ4LWVjMTMxNzIyZjBlNTFhZGQ5MDVjZDAwZDNjODA3ODE2NjdiOGJkMjMwMTZkZmNhZjhiYTE1MjEyNDk0MWJmMzk)
6+
57

68
Uses Facebook GraphQL with Laravel 5. It is based on the PHP implementation [here](https://github.com/webonyx/graphql-php). You can find more information about GraphQL in the [GraphQL Introduction](http://facebook.github.io/react/blog/2015/05/01/graphql-introduction.html) on the [React](http://facebook.github.io/react) blog or you can read the [GraphQL specifications](https://facebook.github.io/graphql/). This is a work in progress.
79

src/Rebing/GraphQL/Support/SelectFields.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ protected static function handleFields(array $requestedFields, $parentType, arra
168168
$foreignKey = $relation->getQualifiedForeignKeyName();
169169
}
170170

171+
$segments = explode('.', $foreignKey);
172+
$foreignKey = end($segments);
171173
$foreignKey = $parentTable ? ($parentTable . '.' . $foreignKey) : $foreignKey;
172174

173175
if(is_a($relation, MorphTo::class))

src/Rebing/GraphQL/Support/Type.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ public function toType()
123123
{
124124
return new InputObjectType($this->toArray());
125125
}
126-
if ($this->enumObject) {
126+
if ($this->enumObject)
127+
{
127128
return new EnumType($this->toArray());
128129
}
129130
return new ObjectType($this->toArray());

0 commit comments

Comments
 (0)