-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14eec41
commit ef8a95b
Showing
6 changed files
with
77 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
namespace Buoy\LighthouseFairway\Exceptions; | ||
|
||
class NoSubscriptionException extends \Exception { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Buoy\LighthouseFairway\Subscriptions; | ||
|
||
use Nuwave\Lighthouse\Schema\Types\GraphQLSubscription; | ||
use Nuwave\Lighthouse\Subscriptions\Subscriber; | ||
|
||
abstract class FairwayModelEventSubscription extends GraphQLSubscription | ||
{ | ||
abstract public function filterSubscription(Subscriber $subscriber, $root): bool; | ||
|
||
public function filter(Subscriber $subscriber, $root): bool | ||
{ | ||
// Filter based on event type | ||
if (optional($subscriber->args)['events']) { | ||
if (!in_array($root['event'], $subscriber->args['events'])) { | ||
return false; | ||
} | ||
} | ||
|
||
// Custom filtering | ||
return $this->filterSubscription($subscriber, $root); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters