Wp-graphql: v0.3.x - Resolver on type User returning 'false' instead of meta key value

Created on 24 Apr 2019  路  4Comments  路  Source: wp-graphql/wp-graphql

It seems that there is a problem with resolving custom user meta fields with version 0.3.

I made sure to update my action graphql_register_types resolvers by replacing the legacy \WP_User with \WPGraphQL\Model\User but it seems that the User object cannot get resolved with $user->ID unless it is hardcoded.

Below is a reproduction of the issue (gif)...

https://drive.google.com/file/d/1W5URQ92QJOrycQv7lunc2H7EP7zmwf4h/view

question

All 4 comments

@szvest try using $user->userId since $user->ID is the global ID, not the DB int ID now.

Excellent! Works like a charm now. Thanks @CodeProKid.

Thanks @CodeProKid! closing this issue.

ah @szvest beat me to it 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TylerBarnes picture TylerBarnes  路  4Comments

cr101 picture cr101  路  4Comments

saulirajala picture saulirajala  路  3Comments

furenku picture furenku  路  4Comments

reallyfabdigital picture reallyfabdigital  路  3Comments