Skip to content
This repository has been archived by the owner on Feb 10, 2019. It is now read-only.

auto get field from interface #245

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/Folklore/GraphQL/Support/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,16 @@ public function getAttributes()
$interfaces = $this->interfaces();

$attributes = array_merge($this->attributes, [
'fields' => function () {
return $this->getFields();
'fields' => function () use ($interfaces) {
return array_merge(
call_user_func_array("array_merge",
array_map( function ($interface) {
return $interface->getFields();
},
$interfaces
)),
$this->getFields()
);
}
], $attributes);

Expand Down