You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 2, 2024. It is now read-only.
I'm trying to create a sample app for others that want to use graphql-flutter and artemis, while learning how to use them myself.
It appears that fragments can only be used with FetchPolicy.noCache (not even FetchPolicy.networkOnly. Removing the cache eliminates a huge part of what makes graphl-flutter appealing, so is there any way to use artemis with fragments and cache?
returnQuery(
options:QueryOptions(
document:POKEMON_LIST_QUERY_DOCUMENT,
operationName:POKEMON_LIST_QUERY_DOCUMENT_OPERATION_NAME,
fetchPolicy:FetchPolicy.noCache, // This prevents using the cache!!
),
builder: (QueryResult result, {fetchMore, refetch}) {
if (result.isLoading) returnCircularProgressIndicator();
if (result.hasException) returnCenter(child:Text(result.exception!.toString()));
print("result is $result");
// >>>>>result.data is missing all fragment data with a different fetch policy <<<<<final data =PokemonList$Query.fromJson(result.data!);
final cardList = data.pokemons!.results!.map((pokemon) {
print("Pokemon name: ${pokemon!.name}");
returnPokemonListCard(itemFrag: pokemon);
}).toList();
returnRefreshIndicator(
child:ListView(children: cardList),
onRefresh: () async {
awaitrefetch!();
});
});
I'm trying to create a sample app for others that want to use graphql-flutter and artemis, while learning how to use them myself.
It appears that fragments can only be used with
FetchPolicy.noCache(not evenFetchPolicy.networkOnly. Removing the cache eliminates a huge part of what makes graphl-flutter appealing, so is there any way to use artemis with fragments and cache?In
main.dartIn
app.dartIn
pokemon_list.query.graphqlIn
pokemon_list_card.fragment.graphqlIn
pokemon_list.dart