actionGoodById.js 588 B

1234567891011121314151617181920212223
  1. import { gql } from "../helpers";
  2. import { actionPromise } from "../reducers";
  3. export const actionGoodById = ({ _id, promiseName = "goodById" } = {}) =>
  4. actionPromise(
  5. promiseName,
  6. gql(
  7. `query GoodById($q:String){
  8. GoodFindOne(query: $q){
  9. _id name amount description price
  10. categories{
  11. _id name
  12. }
  13. images{
  14. _id
  15. url
  16. }
  17. }
  18. }`,
  19. { q: JSON.stringify([{ _id }]) }
  20. )
  21. );