wp-graphql / wp-graphql-jwt-authentication

Authentication for WPGraphQL using JWT (JSON Web Tokens)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot query field jwtRefreshToken

Khadreal opened this issue · comments

I'm trying to query the viewer endpoint to get jwtRefreshToken, this is my query

query RequestAuthRefreshToken {
      viewer {
        id
        jwtRefreshToken
      }
}

I got this error

{
  "errors": [
    {
      "message": "Cannot query field \"jwtRefreshToken\" on type \"User\".",
      "extensions": {
        "category": "graphql"
      },
      "locations": [
        {
          "line": 4,
          "column": 9
        }
      ]
    }
  ],
  "extensions": {
    "debug": []
  }
}

Please any idea what the issue is

@Khadreal Please provide more information of your setup.

  • Which version of wp-graphql-jwt-authentication?
  • Which version of WP GraphQL?
  • Which version of WordPress?
  • Which version of PHP?

I can't reproduce this issue with wp-graphql-jwt-authentication 0.5.2, WP GraphQL 1.8.2, WordPress 6.0, and any of PHP 7.4, 8.0, or 8.1.

Thanks @ojohnny,

wp-graphql-jwt-authentication -- 0.5.2
wp-graphql -- 1.8.2
WordPress -- 5.9.3
PHP -- 7.4.29

I think the issue was from my end, I was trying to add jwtRefreshToken to another node using graphql_jwt_user_types filter, commenting it out added it back to viewer.

Thanks @ojohnny