Guest User

Untitled

a guest
Jun 24th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 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. // defined shape of HOC type
  14. type UserInfomationQueryPropTypes = { }
  15. type UserInfomationQueryData = { }
  16. type UserInfomationQueryVariables = { }
  17. type UserInfomationQueryResultPropTypes = { }
  18.  
  19. export default compose(
  20. graphql<UserInfomationQueryPropTypes, UserInfomationQueryData, UserInfomationQueryVariables, UserInfomationQueryResultPropTypes>(USER_INFOMATION_QUERY, {
  21. props: ({ }) =>{
  22.  
  23. return {
  24.  
  25. }
  26. }
  27. }),
  28.  
  29.  
  30. // over here, it need to merge result type from type above to prop type of current HOC
  31. graphql<UserNotificationQueryPropTypes & UserInfomationQueryResultPropTypes, UserNotificationQueryData, UserNotificationQueryVariables, UserNotificationQueryResultProps>(USER_NOTIFICATION_QUERY, {
  32.  
  33. }),
  34.  
  35. ... and so on 🙀
  36.  
  37. )(UserInfomationComponent) as React.SFC<UserInfomationContainerPropTypes>
Add Comment
Please, Sign In to add comment