File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import StarBorderIcon from 'material-ui-icons/StarBorder'
8
8
import gql from 'graphql-tag'
9
9
import { graphql , compose } from 'react-apollo'
10
10
import classNames from 'classnames'
11
+ import pick from 'lodash/pick'
11
12
12
13
import { validateReview } from '../lib/validators'
13
14
import { REVIEWS_QUERY , REVIEW_ENTRY } from '../graphql/Review'
@@ -146,12 +147,13 @@ const withAddReview = graphql(ADD_REVIEW_MUTATION, {
146
147
stars,
147
148
createdAt : new Date ( ) ,
148
149
favorited : false ,
149
- author : {
150
- __typename : 'User' ,
151
- name : user . name ,
152
- photo : user . photo ,
153
- username : user . username
154
- }
150
+ author : pick ( user , [
151
+ '__typename' ,
152
+ 'id' ,
153
+ 'name' ,
154
+ 'photo' ,
155
+ 'username'
156
+ ] )
155
157
}
156
158
} ,
157
159
update : ( store , { data : { createReview : newReview } } ) => {
@@ -198,4 +200,7 @@ const withEditReview = graphql(EDIT_REVIEW_MUTATION, {
198
200
} )
199
201
} )
200
202
201
- export default compose ( withAddReview , withEditReview ) ( ReviewForm )
203
+ export default compose (
204
+ withAddReview ,
205
+ withEditReview
206
+ ) ( ReviewForm )
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ initAuthHelpers({
32
32
const USER_QUERY = gql `
33
33
query UserQuery {
34
34
currentUser {
35
+ id
35
36
firstName
36
37
name
37
38
username
You can’t perform that action at this time.
0 commit comments