1 | const notifyPost = ({postId}) => { |
2 | return { |
3 | version: "2018-05-29", |
4 | method: "POST", |
5 | params: { |
6 | query: {}, |
7 | headers: { |
8 | "Content-Type" : "application/json" |
9 | }, |
10 | body: JSON.stringify({ |
11 | query: `mutation notifyPost($postId: ID!) { |
12 | notifyPost(postId: $postId) { |
13 | userId |
14 | post { |
15 | id |
16 | text |
17 | date |
18 | author { |
19 | id |
20 | } |
21 | } |
22 | } |
23 | }`, |
24 | operationName: "notifyPost", |
25 | variables: { |
26 | postId, |
27 | } |
28 | }) |
29 | }, |
30 | resourcePath: "/graphql" |
31 | }; |
32 | }; |
33 | |
34 | |
35 |