1import { graphql } from './graphql';
2
3const pokemonFragment = graphql(`
4 fragment PokemonBasicInfo on Pokemon {
5 id
6 name
7 }
8`);
9
10// This query correctly includes the fragment as a dep
11const FirstQuery = graphql(
12 `
13 query FirstQuery {
14 pokemons(limit: 1) {
15 ...PokemonBasicInfo
16 }
17 }
18 `,
19 [pokemonFragment]
20);
21
22// This query uses the fragment but DOES NOT include it as a dep
23// It should show an error, but currently doesn't because the fragment
24// was already added as a dep in FirstQuery above
25const SecondQuery = graphql(`
26 query SecondQuery {
27 pokemons(limit: 2) {
28 ...PokemonBasicInfo
29 }
30 }
31`);
32
33export { FirstQuery, SecondQuery };