Guest User

Untitled

a guest
Jun 24th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. import { USER_INFOMATION_QUERY, USER_NOTIFICATION_QUERY, USER_INFOMATION_MUTATION } from './user.graphql'
  2. import { graphql, compose } from 'react-apollo'
  3. import UserInfomationComponent from './user.component'
  4.  
  5.  
  6.  
  7. // need to defined shape of
  8. // prop types from enhanced component
  9. type UserInfomationContainerPropTypes = {
  10. userId: string
  11. }
  12.  
  13. export default compose(
  14. graphql<any,any,any,any>(USER_INFOMATION_QUERY, {
  15. props: ({ }) =>{
  16.  
  17. return {
  18.  
  19. }
  20. }
  21. }),
  22.  
  23.  
  24. // over here, it need to merge result type from type above to prop type of current HOC
  25. graphql<any,any,any,any>(USER_NOTIFICATION_QUERY, {
  26.  
  27. }),
  28.  
  29. ... Dont give a F about hoc type anymore
  30.  
  31. )(UserInfomationComponent) as React.SFC<UserInfomationContainerPropTypes>
Add Comment
Please, Sign In to add comment