Skip to content

Commit

Permalink
Handle empty schema extension config
Browse files Browse the repository at this point in the history
  • Loading branch information
ttrig committed Feb 2, 2024
1 parent 0d64e95 commit edd738f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- Handle empty schema extension config.

## [10.1.0] - 2024-02-02

Expand Down
10 changes: 8 additions & 2 deletions src/Concerns/HandlesGraphqlRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,16 @@ public function schemaPath()

public function schemaExtensions()
{
$path = Str::finish($this->schemaExtensionsPath(), DIRECTORY_SEPARATOR);
$path = $this->schemaExtensionsPath();
$glob = $this->schemaExtensionsGlob();

return collect(glob("{$path}{$glob}"))->map(file_get_contents(...))->toArray();
if ($path && $glob) {
$path = Str::finish($path, DIRECTORY_SEPARATOR);

return collect(glob("{$path}{$glob}"))->map(file_get_contents(...))->toArray();
}

return [];
}

public function schemaExtensionsPath()
Expand Down

0 comments on commit edd738f

Please sign in to comment.