Skip to content

Commit e0615ed

Browse files
✨ Support only MongoDB\Laravel namespace
1 parent 1826924 commit e0615ed

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/Support/SelectFields.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -260,16 +260,9 @@ protected static function handleFields(
260260

261261
protected static function isMongodbInstance(GraphqlType $parentType): bool
262262
{
263-
$jenssegersMongoType = 'Jenssegers\Mongodb\Eloquent\Model';
264-
$laravelMongoType = 'MongoDB\Laravel\Eloquent\Model';
263+
$mongoType = 'MongoDB\Laravel\Eloquent\Model';
265264

266-
if (isset($parentType->config['model'])) {
267-
$modelInstance = app($parentType->config['model']);
268-
269-
return $modelInstance instanceof $jenssegersMongoType || $modelInstance instanceof $laravelMongoType;
270-
}
271-
272-
return false;
265+
return isset($parentType->config['model']) ? app($parentType->config['model']) instanceof $mongoType : false;
273266
}
274267

275268
/**

0 commit comments

Comments
 (0)