Guest User

Untitled

a guest
Aug 22nd, 2019
83
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Graphql Fragment
  2. const CURRENT_USER_FRAGMENT = gql`
  3. fragment UserFragment on User {
  4. _id
  5. firstName
  6. lastName
  7. description
  8. picture
  9. email
  10. }
  11. `
  12.  
  13. // Graphql Query
  14. const CURRENT_USER = gql`
  15. ${CURRENT_USER_FRAGMENT}
  16. query CurrentUser {
  17. user {
  18. ...UserFragment
  19. }
  20. }
  21. `
  22.  
  23. CurrentUserComponent = (props: CurrentUser.Props) => (
  24. <div>
  25. Hello {props.data.firstName} {props.data.lastName}
  26. </div>
  27. )
  28.  
  29. export default compose<CurrentUser.Props, {}>(
  30. CurrentUser.HOC({})
  31. )(CurrentUserComponent)
RAW Paste Data