Lighthouse: Remove subscriptions

Created on 12 Sep 2019  路  4Comments  路  Source: nuwave/lighthouse

I'm testing subscriptions on local so I cannot set a webhook and set the type to presence to remove unused subscriptions.

There is a way to delete the subscriptions manually or a better way on working with subscriptions on local?

question

Most helpful comment

Sorry, this is what you can do to clear all subscriptions:

$cache = app(\Illuminate\Cache\CacheManager::class)->store(config('lighthouse.subscriptions.storage', 'redis'));
$cache->clear();

All 4 comments

You can manage those subscriptions using:

$storage = app(\Nuwave\Lighthouse\Subscriptions\Contracts\StoresSubscriptions::class)
$storage->deleteSubscriber($channelName);

But you will have to know those channel names.

So maybe you can get all those names from the CacheManager, or find a way to just delete all.

$cache = app(\Illuminate\Cache\CacheManager)->store(config('lighthouse.subscriptions.storage', 'redis'));

If you're using redis, maybe you can also run FLUSHDB in the redis-cli

Sorry, this is what you can do to clear all subscriptions:

$cache = app(\Illuminate\Cache\CacheManager::class)->store(config('lighthouse.subscriptions.storage', 'redis'));
$cache->clear();

Please follow the issue templates and use StackOverflow or Slack for support questions.

Sorry, this is what you can do to clear all subscriptions:

$cache = app(\Illuminate\Cache\CacheManager::class)->store(config('lighthouse.subscriptions.storage', 'redis'));
$cache->clear();

Nice! Thank you very much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

souljacker picture souljacker  路  3Comments

eriktisme picture eriktisme  路  4Comments

sadhakbj picture sadhakbj  路  4Comments

spawnia picture spawnia  路  4Comments

mikeerickson picture mikeerickson  路  3Comments