- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 4.8k
 
Excluding keys that have trailing "edges.node" on them #7273
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
Excluding keys that have trailing "edges.node" on them #7273
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 | 
    
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.
LGTM!
…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