Need help with 403 Forbidden error in Remix App using GraphQL?

ZeAdventure
Shopify Partner
3 0 0

Hello everyone,

 

Thank you in advance for your help, I want to rebuild one of my app with the new stack remix->prisma.

So I just started and want to do a simple query with graphql in my app.jsx

 

 

 

 

export const loader = async ({ request }) => {
  const { admin } = await authenticate.admin(request);

  admin.graphql(
    `#graphql
  query getProducts {
    products (first: 3) {
      edges {
        node {
          id
          title
        }
      }
    }
  }`
  ).catch((error)=>{
    console.log(error);
  });


  return json({ apiKey: process.env.SHOPIFY_API_KEY || "" });
};

 

 

 

 

Unfortunately I get a forbidden error :

source: '{"errors":{"networkStatusCode":403,"message":"GraphQL Client: Forbidden","response":{}}}'

So I already checked :

 

Scopes,

AppURL,

Client ID,

Client Secret

Honestly it make several hours I try to find the origin of issue and I am totally lost. 

I would be really happy if someone can provide me insight (if you need more part of code I will provide).

Replies 0 (0)