Hello everyone, despite I read also some posts from other people with my similar issues and after tried theirs fix, I still donāt manage to connect to my new environment.
So I am sure my environment it is NOT on the way to be created, I already places content, and create a new token API under it, with editor role. But I anyway get the ā401 ā¦INVALID_AUTHORIZATION_HEADERā. So I also read that, can be used the graphql.datocms.com end point and so on, so this is my code. It seems still I might be missing something
import { GraphQLClient } from "graphql-request";
export function request({ query, variables, preview, includeDrafts }) {
const endpoint = preview
? `https://graphql.datocms.com/preview`
: `https://graphql.datocms.com/`;
const headers = {
authorization: `Bearer ${process.env.VUE_APP_CMS_DATOCMS_API_TOKEN_DEV}`,
"X-Environment": "developer"
};
if (includeDrafts) {
headers['X-Include-Drafts'] = 'true';
}
const client = new GraphQLClient(endpoint, { headers });
return client.request(query, variables);
}
Also to add on top, I went to the API explorer, and when trying to filter the records with the new token, i got a blank page, with the following error on console
Will be glad if someone can give me a bit of light . Thank you in advance