DEV Community

Discussion on: GraphQL Auth with Passport and Lighthouse PHP

Collapse
 
kevinpallado profile image
Kevin Pallado

Hi luis, instead of having the default user table. Use my table with user info? Sorry for asking this im starting to learn laravel deeply specially on API part, hope you can give me guide

Collapse
 
joselfonseca profile image
Jose Luis Fonseca

Hey there, so you need to configure your laravel App to authenticate with that table as well as the model and passport, Once you have that configured and working this package should work as it just uses Passport and the laravel auth behind the scenes.

Collapse
 
kevinpallado profile image
Kevin Pallado

hi jose, can you help me out? I got these error even the model are exists

error => {
"message": "Cannot query field \"_id\" on type \"User\". Did you mean \"id\"?",
"extensions": {
"category": "graphql"
},

this is my auth configuration
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],

    'api' => [
        'driver' => 'passport',
        'provider' => 'users',
        'hash' => false,
    ],
],

'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\Models\User\User::class,
],
]

I am trying to figure this out but sad to say I cant solve it

Thread Thread
 
joselfonseca profile image
Jose Luis Fonseca

Hey there, you are trying to query a field _id but that field does not exist, it should be id without the _

Thread Thread
 
kevinpallado profile image
Kevin Pallado

I am using my own user table, Im not relying on laravel's user default table. And I think I cannot see my own model, although I already configure the auth on using my own user table. Can you help me out?

Thread Thread
 
kevinpallado profile image
Kevin Pallado

Hi jose just for the update, I got this kind of error

'''The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed."''