actionQueries.js 1.0 KB

123456789101112131415161718192021222324252627282930
  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}
  21. }
  22. owner {_id login nick
  23. avatar {url}
  24. }
  25. }
  26. }`,
  27. variables: { id: JSON.stringify([{ _id: match.params.id }]) }
  28. }),
  29. }