Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with GraphQL API in a fresh bagisto installation #47

Closed
AxilleasMoukoulis opened this issue Dec 1, 2021 · 3 comments
Closed

Comments

@AxilleasMoukoulis
Copy link

AxilleasMoukoulis commented Dec 1, 2021

Hello,

I'm new to laravel and bagisto and i would like to request your assistance on the following issue that i'm facing. I have installed bagisto in a docker container (it includes all the prerequisites) and it works as expected. However, i would like to have admin access via API in order to be able to manipulate customer profiles (add, update, remove e.t.c ) from another app. After consulting the documentation, i've stumbled upon the GraphQLAPI that bagisto offers. So, i've proceeded with the installation as instructed in bagisto/headless-ecommerce. Please find below my steps:
Screenshot 2021-12-01 at 3 54 07 PM

Screenshot 2021-12-01 at 3 55 30 PM

Screenshot 2021-12-01 at 3 58 51 PM

Then,

Screenshot 2021-12-01 at 4 01 16 PM
Screenshot 2021-12-01 at 4 01 36 PM
Screenshot 2021-12-01 at 4 01 51 PM

And finally,

Screenshot 2021-12-01 at 4 03 55 PM

Screenshot 2021-12-01 at 4 04 56 PM

Screenshot 2021-12-01 at 4 06 00 PM

Unfortunately, i'm unable to access the graphql API. Below you may find the errors that i'm receiving both in Postman and GraphQL Playground

Screenshot 2021-12-01 at 3 50 07 PM

Screenshot 2021-12-01 at 3 52 28 PM

Could you kindly let me know if i'm missing any essential step during the process? Thank you very much for your time.

@vivek-webkul
Copy link
Member

vivek-webkul commented Dec 3, 2021

@AxilleasMoukoulis
Can you please let us know your Bagisto version?

Also please correct the namespace entries in config/lighthouse.php file: Webkul\GraphQLAPI\ you used Webkull\GraphQLAPI\
https://user-images.githubusercontent.com/16209784/144261478-d666d949-3aed-4441-a76e-c2dbca778a47.png

@AxilleasMoukoulis
Copy link
Author

Hello Vivek,

Thank you very much for your time and the correction that you've pointed out. After trying to troubleshoot the issue, i noticed that the GraphQL route wasn't listed in the routes list of the project.

php artisan route:list

So, i executed the below commands and the issue was resolved:

php artisan config:cache
php artisan route:cache

Now i'm able to access the API from a python client. Maybe you could mention this additional step in the instructions in case anyone has a similar issue. Once again, thank you very much for you time.

@vivek-webkul
Copy link
Member

@AxilleasMoukoulis
Thanks for your suggestion, for sure I will update the user guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants