-
- Notifications
You must be signed in to change notification settings - Fork 4.8k
fix: Relation column is always present in the query result regardless of keys/excludeKeys query parameter #9876
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
base: alpha
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -107,7 +107,13 @@ const load = function (parseGraphQLSchema, parseClass, parseClassConfig: ?ParseG | |
const { keys, include } = extractKeysAndInclude( | ||
selectedFields | ||
.filter(field => field.startsWith('edges.node.')) | ||
.map(field => field.replace('edges.node.', '')) | ||
// GraphQL relation connections expose data under `edges.node.*`. Those | ||
// segments do not correspond to actual Parse fields, so strip them to | ||
// ensure the root relation key remains in the keys list (e.g. convert | ||
// `users.edges.node.username` -> `users.username`). This preserves the | ||
// synthetic relation placeholders that Parse injects while still | ||
// respecting field projections. | ||
.map(field => field.replace('edges.node.', '').replace(/\.edges\.node/g, '')) | ||
Comment on lines +113 to +116 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: i'm not sure to understand what is happening here, because the first replace will strip the edges.node one time, if you try to remove subsequent edges.node like users.edges.node.aRelation.edges.node.name not sure about the impact and if developers use the "edges.node" inside a object field it can break implementation, i think there is an issue here or wrong approach What was the issue here ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To be honest I'm not exactly sure; I saw the Relation column logic fix as relatively straightforward, but then when I ran the whole test suite I encountered a single test in GraphQL that was failing ( So I tried a fix replacing all explicit consecutive There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you need to drop some console.logs on alpha branch to check how this specific GQL test behave, and what is going though the rest call using the GQL api, and then follow the same process on your PR. You are maybe right something was wrong before, but worked, because Keep me updated :) | ||
.filter(field => field.indexOf('edges.node') < 0) | ||
); | ||
const parseOrder = order && order.join(','); | ||
|
Uh oh!
There was an error while loading. Please reload this page.