Merge branch 'master' into story-137818425-tag-staff

This commit is contained in:
gaba
2017-02-10 13:42:50 -08:00
44 changed files with 753 additions and 337 deletions
@@ -0,0 +1,8 @@
fragment actionSummaryView on ActionSummary {
__typename
count
current_user {
id
created_at
}
}
@@ -1,3 +1,5 @@
#import "../fragments/actionSummaryView.graphql"
fragment commentView on Comment {
id
body
@@ -10,12 +12,7 @@ fragment commentView on Comment {
id
name: displayName
}
actions {
type: action_type
count
current: current_user {
id
created_at
}
action_summaries {
...actionSummaryView
}
}
@@ -1,3 +1,7 @@
mutation deleteAction ($id: ID!) {
deleteAction(id:$id)
deleteAction(id:$id) {
errors {
translation_key
}
}
}
@@ -1,6 +1,7 @@
import {graphql} from 'react-apollo';
import POST_COMMENT from './postComment.graphql';
import POST_ACTION from './postAction.graphql';
import POST_FLAG from './postFlag.graphql';
import POST_LIKE from './postLike.graphql';
import DELETE_ACTION from './deleteAction.graphql';
import commentView from '../fragments/commentView.graphql';
@@ -21,12 +22,23 @@ export const postComment = graphql(POST_COMMENT, {
}}),
});
export const postAction = graphql(POST_ACTION, {
export const postLike = graphql(POST_LIKE, {
props: ({mutate}) => ({
postAction: (action) => {
postLike: (like) => {
return mutate({
variables: {
action
like
}
});
}}),
});
export const postFlag = graphql(POST_FLAG, {
props: ({mutate}) => ({
postFlag: (flag) => {
return mutate({
variables: {
flag
}
});
}}),
@@ -1,5 +0,0 @@
mutation CreateAction ($action: CreateActionInput!) {
createAction(action:$action) {
id
}
}
@@ -2,6 +2,11 @@
mutation CreateComment ($asset_id: ID!, $parent_id: ID, $body: String!) {
createComment(asset_id:$asset_id, parent_id:$parent_id, body:$body) {
...commentView
comment {
...commentView
}
errors {
translation_key
}
}
}
@@ -0,0 +1,10 @@
mutation CreateFlag($flag: CreateFlagInput!) {
createFlag(flag:$flag) {
flag {
id
}
errors {
translation_key
}
}
}
@@ -0,0 +1,10 @@
mutation CreateLike ($like: CreateLikeInput!) {
createLike(like:$like) {
like {
id
}
errors {
translation_key
}
}
}
@@ -13,7 +13,7 @@ function getQueryVariable(variable) {
}
// If no query is included, return a default string for development
return 'http://localhost:3030';
return 'http://localhost/default/stream';
}
export const queryStream = graphql(STREAM_QUERY, {