Open arrrrny opened 2 months ago
Thanks for the report. This occurs because we are missing a field resolver for the roles
field on the User type.
We should add one here: https://github.com/vendure-ecommerce/vendure/blob/b5f41f04f79ac15e3656b879beb6f118a381b4e2/packages/core/src/api/resolvers/entity/user-entity.resolver.ts#L13
Are you interested in making a PR for this?
Thanks for the report. This occurs because we are missing a field resolver for the
roles
field on the User type.We should add one here:
Are you interested in making a PR for this?
Here you go
Describe the bug When a customer is authenticated in the shop-api, it has the 'User' data type for the user field. 'User' field has roles property, when I try to query roles from the user, I get an error.
To Reproduce in shop api Authenticate a customer, which already has customer as the user role, and try to query below.
if roles are omitted, query works just fine
Expected behavior Expected behavior is to ber able to fecth the user roles as defined in the return data type, or have CurrentUser data type as the returned data type for the user field.
If I query it from the Admin API as an admin , all is good.
Environment (please complete the following information):
Additional context Add any other context about the problem here.