-
-
Notifications
You must be signed in to change notification settings - Fork 119
Using fragments prevents using cache #393
Comments
You can find the example project that replicates this problem here https://github.com/baconcheese113/graphql-flutter-artemis-example |
Okay...12 hours straight debugging this problem 🎉 Long ExplanationWhile breakpoint debugging the internals of graphql-flutter, normalize, and Hive I noticed that query_manager.dart#L255 The strange part is that Eventually I dug all the way to At this point I decided to skim through the normalize README and this caught my attention
So I added the TLDREvery field that returns a list of objects must include the PreventionI'm not sure how difficult this would be, but if there was a way to add |
Hi @baconcheese113 We cannot add |
I'm working on a PR now to add the user specified /// Instantiate a class definition.
ClassDefinition({
required Name name,
Iterable<ClassProperty> properties = const [],
this.extension,
this.implementations = const [],
this.mixins = const [],
this.factoryPossibilities = const {},
ClassPropertyName? typeNameField,
this.isInput = false,
}) : typeNameField = typeNameField ?? ClassPropertyName(name: '__typename'),
properties = properties.any((p) => p.name.name == (typeNameField?.name ?? '__typename'))
? properties
: [
...properties,
ClassProperty(
type: TypeName(name: 'String'),
name: typeNameField ?? ClassPropertyName(name: '__typename'),
annotations: ['JsonKey(name: \'${typeNameField?.name ?? '__typename'}\')'],
isResolveType: true,
)
],
super(name: name); This would at least align the functionality with the functionality of gql that a lot of users would be migrating to Artemis from. But couldn't we also read the schemaMap while creating a new |
@baconcheese113 we already have fix for that |
Any plans to release a new stable version? I'm not sure if all users are aware there are large differences between the stable and beta version that they need to read a different readme to discover, I wasn't |
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.dart
In
app.dart
In
pokemon_list.query.graphql
In
pokemon_list_card.fragment.graphql
In
pokemon_list.dart
The text was updated successfully, but these errors were encountered: