actionQueries.js 1009 B

12345678910111213141516171819202122232425262728
  1. export const queries = {
  2. "/post/:id": match => ({
  3. name: 'postOne',
  4. query: `query post($id:String!) {
  5. PostFindOne(query:$id) {
  6. _id createdAt title text
  7. images{_id url text}
  8. comments {
  9. _id createdAt text
  10. likes { _id owner {_id}}
  11. answers{
  12. _id createdAt text
  13. likes{ _id}
  14. }
  15. answerTo {
  16. _id text createdAt
  17. }
  18. }
  19. likes{ _id}
  20. owner {_id login nick
  21. avatar {url}
  22. }
  23. }
  24. }`,
  25. variables: { id: JSON.stringify([{ _id: match.params.id }]) }
  26. }),
  27. }