-
-
Notifications
You must be signed in to change notification settings - Fork 628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AST-based normalization / denormalization #471
Comments
Oh man, finally looking at this and it's super exciting. I can't wait to delete |
Can't wait to have aliases supported in my cache. Could I use it now? |
Would it get the cache by looking at if all the fields are in it? |
As mentioned in #629, this will also solve the broken cache behavior of query queryA {
abc {
fieldA, fieldB
}
}
# resolves the partial from `queryA` which is entirely incorrect
query queryB {
abc {
fieldC, fieldD
}
} |
closed with |
With the addition of AST-based operations in #429, I'd like to propose that we implement AST-aware cache normalization / denormalization.
This will allow us to only read the requested fields from the cache, which will allow us to get rid of all the dereferencing code.
It will also make it trivial to implement readQuery / readFragment & writeQuery / writeFragment as requested in #176.
I just published normalize, a GraphQL AST-based normalization library as a first step. I've tested it for all the common use cases, and it currently supports:
Per @klavs's suggestion, it also addresses #400 as it serializes query fields with their variables (like Apollo does, with optional field-level config via FieldPolicies).
Please let me know your thoughts.
The text was updated successfully, but these errors were encountered: