-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Specify fields in key, or allow separate load/cache keys #31
Comments
I have few questions unresolved,
pub struct Person {
id: String,
name: String,
birthday: String
}
impl BatchFn<(PersonID, Vec<String>), Person> for PersonBatcher {
...
}
|
I think you'd somehow want to merge the requested fields, so if you have a request for So, this requested Because you might have partial data you'd probably need to implement As I've been think about this the past few days I've come to realise this adds a large degree of complexity for (in most cases) fairly minimal performance gains. Therefore I think the feature is probably unnecessary (at least for my use cases) in hindsight, thanks for your thoughts either way though. Alternatively, it might be a feature that'd be better suited to a different crate. Although for such a crate to be possible I believe changing the constraint on loader |
I am wanting to only load requested fields from the database. For example, take this GraphQL type:
With the following request:
Rather than doing
SELECT * FROM people
, I want to only get theid
andname
fields; notbirthday
.It seems that in the official Node based module they recommend using separate cache and load keys. This means
BatchFn
might use(PersonID, Vec<String>)
as its ID, butLoader
would usePersonID
. Multiple load keys map to one cache key; so it'd be up to theBatchFn
implementation to dedup the person/fields combinations.The text was updated successfully, but these errors were encountered: