src/Subscriptions/SubscriptionRegistry.php
public function subscriptions(Subscriber $subscriber): Collection
    {
        // A subscription can be fired w/out a request so we must make
        // sure the schema has been generated.
        $this->graphQL->prepSchema();

        return (new Collection($subscriber->query->definitions))
            ->filter(function (Node $node): bool {
                return $node instanceof OperationDefinitionNode;
            })
            ->filter(function (OperationDefinitionNode $node): bool {
                return $node->operation === 'subscription';
            })
            ->flatMap(function (OperationDefinitionNode $node) {
                return (new Collection($node->selectionSet->selections))
                    ->map(function (FieldNode $field): string {
                        return $field->name->value;
                    })
                    ->toArray();
            })
            ->map(function ($subscriptionField): GraphQLSubscription {
                return Arr::get(
                    $this->subscriptions,
                    $subscriptionField,
                    new NotFoundSubscription
                );
            });
    }
public function subscriptions(Subscriber $subscriber): Collection
    {
        // A subscription can be fired w/out a request so we must make
        // sure the schema has been generated.
        $this->graphQL->prepSchema();

        return (new Collection($subscriber->query->definitions))
            ->filter(function (Node $node): bool {
                return $node instanceof OperationDefinitionNode;
            })
            ->filter(function (OperationDefinitionNode $node): bool {
                return $node->operation === 'subscription';
            })
            ->flatMap(function (OperationDefinitionNode $node) {
                return (new Collection($node->selectionSet->selections))
                    ->map(function (FieldNode $field): string {
                        return $field->name->value;
                    })
                    ->toArray();
            })
            ->map(function ($subscriptionField): GraphQLSubscription {
                return Arr::get(
                    $this->subscriptions,
                    $subscriptionField,
                    new NotFoundSubscription
                );
            });
    }
public function subscriptions ( Subscriber $ subscriber ) : Collection { // A subscription can be fired w/out a request so we must make // sure the schema has been generated. $ this -> graphQL -> prepSchema ( ) ; return ( new Collection ( $ subscriber -> query -> definitions ) ) -> filter ( function ( Node $ node ) : bool { return $ node instanceof OperationDefinitionNode ; } ) -> filter ( function ( OperationDefinitionNode $ node ) : bool { return $ node -> operation === 'subscription' ; } ) -> flatMap ( function ( OperationDefinitionNode $ node ) { return ( new Collection ( $ node -> selectionSet -> selections ) ) -> map ( function ( FieldNode $ field ) : string { return $ field -> name -> value ; } ) -> toArray ( ) ; } ) -> map ( function ( $ subscriptionField ) : GraphQLSubscription { return Arr :: get ( $ this -> subscriptions , $ subscriptionField , new NotFoundSubscription ) ; } ) ; }
Get registered subscriptions.

@param  \Nuwave\Lighthouse\Subscriptions\Subscriber  $subscriber
@return \Illuminate\Support\Collection
Get registered subscriptions .