You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/GraphQLTypeGenerator.php
+4-5Lines changed: 4 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -270,7 +270,7 @@ private function generateFieldCode(AbstractBeanPropertyDescriptor $descriptor) :
270
270
$type = $this->getType($descriptor);
271
271
272
272
if ($type === null) {
273
-
return" // Field $getterName is ignored. Cannot represent a JSON field in GraphQL.";
273
+
return" // Field $getterName is ignored. Cannot represent a JSON or BLOB field in GraphQL.";
274
274
}
275
275
276
276
$code = <<<EOF
@@ -284,7 +284,6 @@ protected function {$getterName}Field() : Field
284
284
return $thisVariableName;
285
285
}
286
286
287
-
288
287
EOF;
289
288
290
289
return$code;
@@ -300,8 +299,8 @@ private function getType(AbstractBeanPropertyDescriptor $descriptor) : ?string
300
299
301
300
$phpType = $descriptor->getPhpType();
302
301
if ($descriptorinstanceof ScalarBeanPropertyDescriptor) {
303
-
if ($phpType === 'array') {
304
-
// JSON type cannot be casted since GraphQL does not allow for untyped arrays.
302
+
if ($phpType === 'array' || $phpType === 'resource') {
303
+
// JSON and BLOB type cannot be casted since GraphQL does not allow for untyped arrays or BLOB.
305
304
returnnull;
306
305
}
307
306
@@ -314,7 +313,7 @@ private function getType(AbstractBeanPropertyDescriptor $descriptor) : ?string
314
313
];
315
314
316
315
if (!isset($map[$phpType])) {
317
-
thrownewGraphQLGeneratorNamespaceException("Cannot map PHP type '$phpType' to any known GraphQL type.");
316
+
thrownewGraphQLGeneratorNamespaceException("Cannot map PHP type '$phpType' to any known GraphQL type in table '{$descriptor->getTable()->getName()}' for column '{$descriptor->getColumnName()}'.");
0 commit comments