Shopify Remix Api

Topic summary

A developer is building a Shopify app with Remix and attempting to create a public API endpoint in api.getProducts.jsx that returns the first 10 products from a shop.

Current Issue:

  • The code is not working as intended
  • Using shopify.unauthenticated.storefront() to query products via GraphQL
  • Encountering a “Forbidden error” when trying to access the endpoint

Technical Details:

  • The implementation uses GraphQL to query product data (id, title, description)
  • Attempting to fetch first 10 products and return as JSON
  • Developer mentions only having Shopify API key and secret in .env file

Status:

  • The discussion remains open with unresolved authentication/permission issues
  • Developer is seeking guidance on proper GraphQL usage and how to resolve the Forbidden error for this use case
Summarized with AI on November 8. AI used: claude-sonnet-4-5-20250929.

Apart from that, I need to use for this case, graphQL, how can I use it from here without getting a Forbidden error

 

Error