Closed 4levels closed 6 years ago
Hi @kikoseijo,
I think I managed to get this working: in the Login
Mutation I changed the resolve
function as follows
...
if ($user && app('hash')->check($args['password'], $user->password)) {
$this->deleteExpiredTokens($user);
$user['token'] = $user->createToken('Todo App')->accessToken;
+ app('auth')->setUser($user); // authenticate user with Auth
return $user;
}
...
and in the LoginPayload
Type I added:
+ public function resolveUserField() {
+ return app('auth')->user();
+ }
@4levels move to this package:
https://github.com/nuwave/lighthouse/issues/66
I have just finished integration and its amazing what you can do with a single schema.
Hi @kikoseijo,
very interesting read indeed. Glad Lighthouse is moving forward as it sounds very promising. Currently I've managed to get the whole GraphQL/Lumen/Relay part working except for Relay subscriptions so I'm currently developing the React Native counterpart.
To have a "kind of" subscription like feel, I went around the Relay subscriptions issue by implementing timers in React Native with createRefetchContainer
s
I'll ask in the lighthouse tracker how the subscriptions are going to work since I'm very interested in this.
I'm already working with queueable jobs and message broadcasting by using Redis and a socket.io instance reading the Redis queue. Having this augmented with Relay subscriptions would be ideal!
Hi @kikoseijo,
Could you please verify if you manage to run the login mutation whilst returning the actual user in the response? I do get a token but the expected user element is always empty. I just tested this on a fresh install and I can't seem to get the user object filled in the mutation response..
I'm always getting
user:null
grapqhl:
response: