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
Bug: Stock query returns null despite being present in the database #15738
Comments
I can help with this by:
|
Also not just stocks type in warehouse (which is a good idea), but also please make the stock query work in standalone and specified in docs |
Okay then in this case please add the stocks property to warehouse. It is
crucial to be able to see a warehouses stock without having to load the
entire stock from the database and then filter by warehouse.
Please provide a timeline also 🙏
Teddy Ondieki ***@***.***> schrieb am Sa. 6. Apr. 2024 um
16:05:
… I can help with this by:
1. Updating the documentation to fix the said discrepancy
2. Add a stocks field to the warehouse type to allow the fetching of
stocks related to a particular warehouse
Also not just stocks type in warehouse (which is a good idea), but also
please make the stock query work in standalone and specified in docs Thanks
I was able to fetch a single stock using it's id (not a warehouse ID
which seems to be a mistake in the docs):
Screenshot.2024-04-06.at.12.03.19.png (view on web)
<https://github.com/saleor/saleor/assets/28693198/5a072bff-dd9f-4263-b311-1b0983e7b31c>
—
Reply to this email directly, view it on GitHub
<#15738 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BCULOLCVBI36BE26XYLBVWLY363ELAVCNFSM6AAAAABFRO24WSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBRGAZDGOJRGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
13 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What are you trying to achieve?
I am simply trying to get the stocks of a warehouse ...
Looking at the API reference and code it's supposed to be possible.
Steps to reproduce the problem
Starting from a point of a preconfigured saleor instance containing example products etc.:
Run stocks Query to validate existing stocks:
Take any warehouse ID for some stock with a high quantity and run the stock Query:
Output:
What did you expect to happen?
In the first step I verify that the warehouse contains stock. Using that same warehouse ID in the stock query is logically supposed to give me the stocks of the warehouse.
Also: The APIs documentation is horrible! Look at the docs of the stock query:
Look up a stock by ID
Requires one of the following permissions: MANAGE_PRODUCTS.
Type
Stock
Arguments
id: ID!
ID of a(n) warehouse
'Look up a stock by ID' One might think its own ID, but its the warehouse ID Be a bit more professional please. Fighting such this horrible docs has cost me already days of work. The product is so immature I'm really thinking of switching to something else. Please fix this, querying the stock is the bare minimum an ecommerce backend should be able to allow.
Logs
No response
Environment
Saleor version: ghcr.io/saleor/saleor:3.19
The text was updated successfully, but these errors were encountered: