I keep geting this error:
Error: GraphQL error: Not Authorized!
Code is:
const queries = gql`
query {
mystreak
}
`;
render() {
return (
<Query query={queries}>
{({ loading, error, data }) => {
console.log(loading);
console.log(error);
console.log(data.mystreak);
}}
</Query>
)
}
App is built in React.js, and I am pretty new to GraphQL.
Also data is undefined.
Any ideas?
Thanks in advance
7 Answers
I’m guessing you use Apollo.
We are lacking a lot of information, especially regarding your backend, but it looks like you are missing an Authorization header in your http requests:
https://www.apollographql.com/docs/link/links/http.html#options
const link = createHttpLink({
uri: "/graphql",
headers: {
Authorization: 'Bearer <your token here>'
}
});
Check the documentation of your backend for the token value.
Im not a techie and I never mess with codes and don’t even know where they are. I have not changed anything and when I try to use FaceBook today I can not use Messenger it gives me this error message. I have no idea. I see the codes above but do not believe normal users would pay tech to fix something that they probably fixed to generate more income BOO HISS
Me too. Must be an issue in FB messenger.
1
-
This does not provide an answer to the question. You can search for similar questions, or refer to the related and linked questions on the right-hand side of the page to find an answer. If you have a related but different question, ask a new question, and include a link to this one to help provide context. See: Ask questions, get answers, no distractions
– Steve2 mins ago
Me too. Just started about 45 minutes ago.
1
-
This does not provide an answer to the question. You can search for similar questions, or refer to the related and linked questions on the right-hand side of the page to find an answer. If you have a related but different question, ask a new question, and include a link to this one to help provide context. See: Ask questions, get answers, no distractions
– Steve1 min ago
I just started getting it too on FB messenger. what the heck is going on?
1
-
This does not provide an answer to the question. You can search for similar questions, or refer to the related and linked questions on the right-hand side of the page to find an answer. If you have a related but different question, ask a new question, and include a link to this one to help provide context. See: Ask questions, get answers, no distractions
– Steve2 mins ago
I just got the same error message in FB messenger a few minutes ago.
1
-
This does not provide an answer to the question. You can search for similar questions, or refer to the related and linked questions on the right-hand side of the page to find an answer. If you have a related but different question, ask a new question, and include a link to this one to help provide context. See: Ask questions, get answers, no distractions
– Steve3 mins ago