1import { useQuery } from 'urql';
2import { graphql } from './gql';
3// @ts-expect-error
4import { Pokemon } from './fragment';
5import * as React from 'react';
6
7const PokemonQuery = graphql(`
8 query Po($id: ID!) {
9 pokemon(id: $id) {
10 id
11 fleeRate
12 ...pokemonFields
13 attacks {
14 special {
15 name
16 damage
17 }
18 }
19 weight {
20 minimum
21 maximum
22 }
23 name
24 __typename
25 }
26 }
27`);
28
29const Pokemons = () => {
30 // @ts-expect-error
31 const [{ data: { pokemon: { fleeRate, weight: { minimum, maximum } } } }] = useQuery({
32 query: PokemonQuery,
33 variables: { id: '' }
34 });
35
36 // @ts-expect-error
37 return <Pokemon data={{ fleeRate, weight: { minimum, maximum } }} />;
38}
39