`Invalid host` when I try to access the GraphQL Admin API with REMIX.JS

`Invalid host` when I try to access the GraphQL Admin API with REMIX.JS

Hesam
Shopify Partner
1 0 0

Hey everyone,
Im currently tying to get acces to the grapthql api from my custom app. However, Im getting the following error every time I run the query:

"Invalid host, redirecting to login path | {host: null}"

 

code:

 

 

const { admin } = await authenticate.admin(request);

const response = await admin.graphql(
    `#graphql
  query getProductById($id: ID!) {
    product(id: $id) {
      title
    }
  }`,
    {
      variables: {
        id: "gid://shopify/Product/7676292956318"
      }
    }
  );

 

 


Im not able to authenticate and I guess the issue might be the (request) beeing passed to the admin().

Thanks in advance for any clue, help or guidance!
 



 

Replies 0 (0)