Guest User

Untitled

a guest
Dec 18th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. // src/App.tsx
  2. import * as React from 'react'
  3. import { Query } from 'react-apollo'
  4. import pokemonsQuery from './queries/pokemonsQuery'
  5. import { Pokemons, PokemonsVariables } from './queries/types/Pokemons'
  6.  
  7. class PokemonsQuery extends Query<Pokemons, PokemonsVariables> {}
  8.  
  9. export default class App extends React.Component {
  10. render() {
  11. return (
  12. <PokemonsQuery
  13. query={pokemonsQuery}
  14. variables={{ first: '10' }} // Throws an error!
  15. >
  16. {({ data }) => (
  17. <React.Fragment>
  18. <h1>Pokemons</h1>
  19. <code>
  20. <pre>{JSON.stringify(data, null, 2)}</pre>
  21. </code>
  22. </React.Fragment>
  23. )}
  24. </PokemonsQuery>
  25. )
  26. }
  27. }
Add Comment
Please, Sign In to add comment