Skip to content

Commit 86c74c9

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

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/Support/SelectFields.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -260,18 +260,11 @@ 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
}
274-
267+
275268
/**
276269
* @param string|Expression $field
277270
* @param array $select Passed by reference, adds further fields to select

0 commit comments

Comments
 (0)