2

I am getting this error in production:

exception: "Nuwave\Lighthouse\Exceptions\DefinitionException" file: "/var/www/app/vendor/nuwave/lighthouse/src/Schema/TypeRegistry.php" line: 95 message: "Lighthouse failed while trying to load a type: CreateTicketInput↵↵Make sure the type is present in your schema definition.↵" trace: [,…]

and someone advices to clear the Lighthouse cache here.

But I already used to clear laravel cache with artisan cache:clear So my question is: does artisan cache:clear also remove lighthouse cache?

Cutis
  • 949
  • 1
  • 13
  • 32

1 Answers1

2

In theory, yes. In practice, it depends.

By default Lighthouse uses the default Laravel cache driver so artisan cache:clear should also clear the Lighthouse cache indirectly.

However, if you configured Lighthouse to use a different cache driver than Laravel uses, it will not work.

Long story short: Yes if you use the default cache for Lighthouse artisan cache:clear does clear the Lighthouse cache but do not depend on that, use artisan lighthouse:clear-cache to be sure that now and in the future (and for any configuration) the cache is properly cleared.


It's very likely that in the next version of Lighthouse the cache method will change and no longer make use of the Laravel cache which makes artisan cache:clear no longer affecting the Lighthouse cache so that is another reason to use artisan lighthouse:clear-cache too.

Alex
  • 1,425
  • 11
  • 25