Closed mailofeli closed 9 months ago
I'm trying to access the API directly, as described here: https://shopify.dev/docs/api/app-bridge-library#direct-api-access.
Getting "Fetch API cannot load shopify:admin/api/graphql.json. URL scheme "shopify" is not supported."
Steps to reproduce the behaviour:
I've added this to my TOML file:
[access.admin] direct_api_mode = "online" embedded_app_direct_api_access = true
I'm running the following basic fetch request:
const res = await fetch('shopify:admin/api/graphql.json', { method: 'POST', body: JSON.stringify({ query: query GetProduct($id: ID!) { product(id: $id) { title } } , variables: {id: 'gid://shopify/Product/8344298258728'}, }), });
query GetProduct($id: ID!) { product(id: $id) { title } }
A JSON representation of the product should be returned.
List the relevant packages you’re using, and their versions. For example:
@shopify/app-bridge
3.7.0
@shopify/app-bridge-react
Add any other context about the problem here, such as your app’s configuration (Node, Next.js, Rails).
How did you mange to solve this? I only get a network error
Same issue here with latest version or everything
Describe the bug
I'm trying to access the API directly, as described here: https://shopify.dev/docs/api/app-bridge-library#direct-api-access.
Getting "Fetch API cannot load shopify:admin/api/graphql.json. URL scheme "shopify" is not supported."
To Reproduce
Steps to reproduce the behaviour:
I've added this to my TOML file:
[access.admin] direct_api_mode = "online" embedded_app_direct_api_access = true
I'm running the following basic fetch request:
const res = await fetch('shopify:admin/api/graphql.json', { method: 'POST', body: JSON.stringify({ query:
query GetProduct($id: ID!) { product(id: $id) { title } }
, variables: {id: 'gid://shopify/Product/8344298258728'}, }), });Expected behaviour
A JSON representation of the product should be returned.
Contextual information
Packages and versions
List the relevant packages you’re using, and their versions. For example:
@shopify/app-bridge
@3.7.0
@shopify/app-bridge-react
@3.7.0
Platform
Additional context
Add any other context about the problem here, such as your app’s configuration (Node, Next.js, Rails).