menu

Saleor Commerce

The world’s fastest growing open-source e-commerce platform with billions of dollars transacted. Powered by Python, GraphQL, ReactJS and PWA.

Channels
# All channels
view-forward
# General
view-forward
# Announcements
view-forward
# Design
view-forward
# Development
view-forward
# Saleor Features
view-forward
Team

ERR RUN GRAPHQL

February 17, 2020 at 7:04am
Hi When I run the project and want to get to the dashboard page, I get this error. I know the problem is with graphql but I don't know how to run it! Do I need to run a project to run graphql or do I have to install the program ?! How do I fix the issue and access the dashboard ?! Thank You Very Much 🙏 Screenshots https://user-images.githubusercontent.com/20461826/74583721-50325a80-4fdf-11ea-87fc-2760f85b8fd7.jpg System information Operating system: Windows 10 Browser: Google Chrome

February 17, 2020 at 9:38am
Hi ! If you are running Saleor locally with the default settings, set API_URI to: http://localhost:8000/graphql/. It looks like your API_URI is localhost:9000 right now.
Edited
  • reply
  • like

February 17, 2020 at 3:45pm
It seems you have some CORS problems. Did you change anything in the Saleor's settings?
  • reply
  • like

February 18, 2020 at 6:53am
Hi ! If you are running Saleor locally with the default settings, set API_URI to: http://localhost:8000/graphql/. It looks like your API_URI is localhost:9000 right now.
hi thanks for your response. i did set api_url in the code but i have that same problem yet . I dont know can I solve this problem. Im wondering if it be solve in this project in future than other wont have my problem too.
  • reply
  • like
It seems you have some CORS problems. Did you change anything in the Saleor's settings?
hi . i have just set the api_url in my code . but while nothing go run so I cant see the Saleor's setting. whats your offer for that ?
  • reply
  • like
Could you please tell all the steps you have taken? We need to know more details.
  • reply
  • like

February 18, 2020 at 7:53pm
I saved project from github and I did exactly of installation guide . I replaced all the API_URL for code by "localhost:/8000/graphql". But It doesnt run . I wondering if it will be solve. All the stepts are in below :
Installing
Clone the repository: $ git clone https://github.com/mirumee/saleor-dashboard.git Enter the project directory: $ cd saleor-dashboard
Using stable release
To use the official stable release, checkout to a release tag: $ git checkout v2.0.0
Using development version
If you want to use the latest development version, checkout to the master branch: $ git checkout master Install NPM dependencies: $ npm i
Configuration
There are two environment variables available for configuration:
API_URI (required) - URI of a running instance of Saleor GraphQL API. If you are running Saleor locally with the default settings, set API_URI to: http://localhost:8000/graphql/.
APP_MOUNT_URI - URI at which the Dashboard app will be mounted. E.g. if you set APP_MOUNT_URI to /dashboard/, your app will be mounted at http://localhost:9000/dashboard/.
STATIC_URL - URL where the static files are located. E.g. if you use S3 bucket, you should set it to the bucket's URL. By default Saleor assumes you serve static files from the root of your site at http://localhost:9000/.
Development
To start the development server run: $ npm start
Production
To build the application bundle run: $ npm run build
  • reply
  • like

February 19, 2020 at 2:01am
Export environment variables: export API_URI=http://localhost:8000/graphql/ export APP_MOUNT_URI=/dashboard/
  • reply
  • like

February 19, 2020 at 1:50pm
It could be erroring because you set API_URI without trailing slash, so Saleor redirects you to http://localhost:8000/graphql/, resulting in CORS policy violation
  • reply
  • like

February 20, 2020 at 11:27am
Export environment variables: export API_URI=http://localhost:8000/graphql/ export APP_MOUNT_URI=/dashboard/
I made these changes in the code again but the problem is still not fixed!
  • reply
  • like
It could be erroring because you set API_URI without trailing slash, so Saleor redirects you to http://localhost:8000/graphql/, resulting in CORS policy violation
You mean to run the graphql separately?
  • reply
  • like