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

Unable to create post, Invalid token #37

Closed
beafb opened this issue Jul 8, 2018 · 0 comments
Closed

Unable to create post, Invalid token #37

beafb opened this issue Jul 8, 2018 · 0 comments

Comments

@beafb
Copy link

beafb commented Jul 8, 2018

Hey there,

I'm following the tutorial from howtographql
I was able to signup a new user thanks to this issue #34

Now i'm signing up the user with this mutation

mutation {
  signup(
    email: "test@gmail.com"
    name: "test test"
    password: "123123"
  )
  {
    token
    user {
      id
    }
  }
}

Then i copy the token in the header tab :

{
  "Authorization" : "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjampjd3ZpODFwNGFoMGI4Mnp5dGtxb3FtIiwiaWF0IjoxNTMxMDU4ODgyfQ.WYiy_T-UnmLhlzST3QDbyZABaQwlgcKqh7pYDlnut7g"
} 

And try this mutation :

mutation {
  post(
    url: "www.graphql-europe.org"
    description: "Europe's biggest GraphQL conference"
  ) {
    id
  }
}

To receive this error :

{
  "data": null,
  "errors": [
    {
      "message": "invalid token",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "post"
      ]
    }
  ]
}

I don't get why i'm stuck with this, do you have any hints ?
Thanks in advance

@beafb beafb closed this as completed Jul 8, 2018
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

1 participant