Excluding keys that have trailing "edges.node" on them#7273
Excluding keys that have trailing "edges.node" on them#7273davimacedo merged 3 commits intoparse-community:masterfrom
Conversation
…ot be selectable anyway
Codecov Report
@@ Coverage Diff @@
## master #7273 +/- ##
==========================================
- Coverage 93.94% 93.89% -0.05%
==========================================
Files 179 179
Lines 13152 13154 +2
==========================================
- Hits 12355 12351 -4
- Misses 797 803 +6
Continue to review full report at Codecov.
|
|
Thanks for the PR. Could you please change this test to also run on Postgres so we can make sure it will always work? https://github.com/parse-community/parse-server/blob/master/spec/ParseGraphQLServer.spec.js#L8257 |
|
Any recommendation on how I could test this locally? I'm a little confused as to why it's only failing on that one version of Postgres and I'd like to avoid pushing debug changes over and over. |
|
Something like: export PARSE_SERVER_TEST_DB=postgres
export PARSE_SERVER_TEST_DATABASE_URI=your_local_postgres_uri
npm run testonly |
…ty#7273) * Excluding keys that have trailing "edges.node" on them as they will not be selectable anyway * Updated CHANGELOG and added test case * Forgot to change fit back to it
|
🎉 This change has been released in version 5.0.0-beta.1 |
|
🎉 This change has been released in version 5.0.0 |
New Pull Request Checklist
Issue Description
The issue is trying to call resolvers on relations do not work with Postgres. For example the following query will fail when using Posgres:
Related issue: #6419
Approach
The approach with this PR is to ignore any keys that have a trailing
edges.nodeon them. Using the example above, it will initially have these select keys:This fails because the following fields are being sent to the resolver:
This then gets modified down to:
This array gets passed as the "keys" to the REST query. Down the processing chain the
RestQuerywill chop off everything after the first.so then we're left with['name', 'users']andusersis not a valid column on the_Roletable. This PR will drop theusers.edges.node.usernamekey all together as it would never need to be a selected key in any query.TODOs before merging