src/Plugin/GraphQL/Types/JsonList.php 1 location
|
@@ 18-27 (lines=10) @@
|
| 15 |
|
* unions = {"JsonNode"} |
| 16 |
|
* ) |
| 17 |
|
*/ |
| 18 |
|
class JsonList extends TypePluginBase { |
| 19 |
|
|
| 20 |
|
/** |
| 21 |
|
* {@inheritdoc} |
| 22 |
|
*/ |
| 23 |
|
public function applies($value, ResolveContext $context, ResolveInfo $info) { |
| 24 |
|
return is_array($value) && count(array_filter(array_keys($value), 'is_string')) == 0; |
| 25 |
|
} |
| 26 |
|
|
| 27 |
|
} |
| 28 |
|
|
src/Plugin/GraphQL/Types/JsonObject.php 1 location
|
@@ 18-27 (lines=10) @@
|
| 15 |
|
* unions = {"JsonNode"} |
| 16 |
|
* ) |
| 17 |
|
*/ |
| 18 |
|
class JsonObject extends TypePluginBase { |
| 19 |
|
|
| 20 |
|
/** |
| 21 |
|
* {@inheritdoc} |
| 22 |
|
*/ |
| 23 |
|
public function applies($value, ResolveContext $context, ResolveInfo $info) { |
| 24 |
|
return is_array($value) && count(array_filter(array_keys($value), 'is_string')) > 0; |
| 25 |
|
} |
| 26 |
|
|
| 27 |
|
} |
| 28 |
|
|