-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add support for the filter parameter in the @connection directive #1862
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want to get a second opinion on the resulting store key.
src/data/storeUtils.ts
Outdated
const queryArgs = args as {[key: string]: any}; | ||
|
||
if (filterKeys.length > 0) { | ||
const filterExtra = filterKeys.map((key) => `${key}:${JSON.stringify(queryArgs[key])}`).reduce((a, b) => `${a}_${b}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a pretty random serialization. I guess it's:
fieldName_arg:"value"_otherArg:17
Curious if @jbaxleyiii has an opinion for the right store key. For context I think the current ones look like:
fieldName({arg:"value",otherArg:17})
The appearance matters because this will show up in the dev tools.
Anyway, instead of the reduce
we could use .join('_')
.
Documentation pr at: https://github.com/apollographql/react-docs/pull/247 |
Great work, @shadaj! |
TODO: