Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JWT fields cannot be retrieved via viewer query #41

Closed
mlipscombe opened this issue Jul 16, 2019 · 2 comments
Closed

JWT fields cannot be retrieved via viewer query #41

mlipscombe opened this issue Jul 16, 2019 · 2 comments

Comments

@mlipscombe
Copy link

The following query fails:

{
  viewer {
    userId
    jwtAuthToken
    jwtRefreshToken
  }
}

with this error:
Argument 1 passed to WPGraphQL\\JWT_Authentication\\ManageTokens::WPGraphQL\\JWT_Authentication\\{closure}() must be an instance of WP_User, instance of WPGraphQL\\Model\\User given.

@jasonbahl
Copy link
Collaborator

@mlipscombe checking this out now

jasonbahl added a commit that referenced this issue Jul 18, 2019
- When the Model Layer was introduced it changed the objects that are passed down to fields on the Viewer. This adjusts the field resolvers to expect a User (model) instead of WP_User to be passed down
jasonbahl added a commit that referenced this issue Jul 18, 2019
…ed-via-viewer-query

#41 - JWT fields cannot be retrieved via viewer query
@jasonbahl
Copy link
Collaborator

@mlipscombe I just merged a fix for this. Let me know if it's still causing issues and we can re-open or file a new issue.

jasonbahl added a commit that referenced this issue Jul 18, 2019
- refactored a bit to keep things a bit cleaner
jasonbahl added a commit that referenced this issue Jul 18, 2019
- refactored a bit to keep things a bit cleaner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants