daniel-de-wit / lighthouse-sanctum

Laravel Sanctum support for Laravel Lighthouse
MIT License
57 stars 9 forks source link

@auth directive does not point to sanctum user #74

Closed LiamKarlMitchell closed 2 years ago

LiamKarlMitchell commented 2 years ago

In config/lighthouse.php I had to set this for @auth to work.

'guard' => 'sanctum',

Didn't see it in the readme.

    "Get the logged in user."
    me: User @auth

or

me: @auth('sanctum')

sanctum.graphql

extend type Query {
    me: User @auth
}
wimski commented 2 years ago

When using Sanctum it's pretty much implied that you set it as the guard. The documentation of this package only deals with the specifics of using it with Lighthouse.