@@ -13,34 +13,34 @@ |
||
| 13 | 13 | |
| 14 | 14 | trait ResolvableObjectTrait { |
| 15 | 15 | |
| 16 | - public function resolve($value, array $args, ResolveInfo $info) |
|
| 17 | - { |
|
| 16 | + public function resolve($value, array $args, ResolveInfo $info) |
|
| 17 | + { |
|
| 18 | 18 | if ($this->resolveFunctionCache === null) { |
| 19 | - $this->resolveFunctionCache = $this->getConfig()->getResolveFunction(); |
|
| 19 | + $this->resolveFunctionCache = $this->getConfig()->getResolveFunction(); |
|
| 20 | 20 | |
| 21 | - if (!$this->resolveFunctionCache) { |
|
| 21 | + if (!$this->resolveFunctionCache) { |
|
| 22 | 22 | $this->resolveFunctionCache = false; |
| 23 | - } |
|
| 23 | + } |
|
| 24 | 24 | } |
| 25 | 25 | if ($this->resolveFunctionCache) { |
| 26 | - $resolveFunction = $this->resolveFunctionCache; |
|
| 26 | + $resolveFunction = $this->resolveFunctionCache; |
|
| 27 | 27 | |
| 28 | - return $resolveFunction($value, $args, $info); |
|
| 28 | + return $resolveFunction($value, $args, $info); |
|
| 29 | 29 | } else { |
| 30 | - if (is_array($value) && array_key_exists($this->getName(), $value)) { |
|
| 30 | + if (is_array($value) && array_key_exists($this->getName(), $value)) { |
|
| 31 | 31 | return $value[$this->getName()]; |
| 32 | - } elseif (is_object($value)) { |
|
| 32 | + } elseif (is_object($value)) { |
|
| 33 | 33 | return TypeService::getPropertyValue($value, $this->getName()); |
| 34 | - } elseif ($this->getType()->getNamedType()->getKind() == TypeMap::KIND_SCALAR) { |
|
| 34 | + } elseif ($this->getType()->getNamedType()->getKind() == TypeMap::KIND_SCALAR) { |
|
| 35 | 35 | return null; |
| 36 | - } else { |
|
| 36 | + } else { |
|
| 37 | 37 | throw new \Exception(sprintf('Property "%s" not found in resolve result', $this->getName())); |
| 38 | - } |
|
| 38 | + } |
|
| 39 | + } |
|
| 39 | 40 | } |
| 40 | - } |
|
| 41 | 41 | |
| 42 | 42 | |
| 43 | - public function getResolveFunction() { |
|
| 43 | + public function getResolveFunction() { |
|
| 44 | 44 | return $this->getConfig()->getResolveFunction(); |
| 45 | - } |
|
| 45 | + } |
|
| 46 | 46 | } |
@@ -131,14 +131,14 @@ |
||
| 131 | 131 | |
| 132 | 132 | public static function getEdges($value) |
| 133 | 133 | { |
| 134 | - return isset($value['edges']) ? $value['edges'] : null; |
|
| 134 | + return isset($value['edges']) ? $value['edges'] : null; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | public static function getPageInfo($value) { |
| 138 | - return isset($value['pageInfo']) ? $value['pageInfo'] : null; |
|
| 138 | + return isset($value['pageInfo']) ? $value['pageInfo'] : null; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | public static function getNode($value) { |
| 142 | - return isset($value['node']) ? $value['node'] : null; |
|
| 142 | + return isset($value['node']) ? $value['node'] : null; |
|
| 143 | 143 | } |
| 144 | 144 | } |