jaehyuk-jang

use Data fetching for graphql

1 +export const GQL_URI =
2 + 'http://a5784f2e906ca4512adac13dd73dd23a-8e11745c200f4ae4.elb.ap-northeast-2.amazonaws.com:5000/graphql';
1 +import gql from 'graphql-tag';
2 +
3 +export const CREATE_COMMENT = gql`
4 + mutation CreateComment($input: CreateCommentInput!) {
5 + createComment(input: $input) {
6 + id
7 + author
8 + content
9 + created_date
10 + post_id
11 + }
12 + }
13 +`;
1 +import gql from 'graphql-tag';
2 +
3 +export const CREATE_POST = gql`
4 + mutation CreatePost($input: CreatePostInput!) {
5 + createPost(input: $input) {
6 + id
7 + }
8 + }
9 +`;
1 +import gql from 'graphql-tag';
2 +
3 +export const GET_ALL_POSTS = gql`
4 + query GetAllPosts {
5 + getAllPosts {
6 + id
7 + title
8 + category
9 + }
10 + }
11 +`;
1 +import gql from 'graphql-tag';
2 +
3 +export const GET_SOME_POSTS = gql`
4 + query GetSomePosts($input: GetPostInput!) {
5 + getSomePosts(input: $input) {
6 + category
7 + id
8 + author
9 + title
10 + created_date
11 + }
12 + }
13 +`;
1 +import gql from 'graphql-tag';
2 +
3 +export const GET_POST_WITH_COMMENTS = gql`
4 + query GetPostWithComments($post_id: Float!, $inputComment: GetCommentInput!) {
5 + getPost(id: $post_id) {
6 + id
7 + author
8 + category
9 + created_date
10 + title
11 + content
12 + }
13 + getSomeComments(input: $inputComment) {
14 + id
15 + author
16 + content
17 + created_date
18 + }
19 + }
20 +`;