Skip to content
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

rethink insertBatchResults function #38

Open
tirumaraiselvan opened this issue Jul 3, 2019 · 1 comment
Open

rethink insertBatchResults function #38

tirumaraiselvan opened this issue Jul 3, 2019 · 1 comment

Comments

@tirumaraiselvan
Copy link
Owner

tirumaraiselvan commented Jul 3, 2019

User are facing issues in the join function.

I'm having issues with remote joins
Specifically no remote objects left for joining at
I can confirm the request is beign sent to my remote schema correctly, so it seems the issue is the handling of the response by hasura.


When using Remote joins, I get this error "message": "no remote objects left for joining at {"descriptionRich":"# F&C"}":thinking:

@tirumaraiselvan tirumaraiselvan changed the title unit test insertBatchResults function rethink insertBatchResults function Aug 21, 2019
@tirumaraiselvan
Copy link
Owner Author

tirumaraiselvan commented Aug 21, 2019

Current logic is as follows which relies on the following invariant

  1. Remote relationship field can only occur at the leaf of the query structure.
  2. Remote query is aliased according to the order of the hasura result set
    i.e "remote_result_1" will be the result for "hasura_result_1" where "hasura_result_1" is the first leaf field which contains the remote field.

Algo:

Sort all remote results by their alias. Call this array: remote_results

Traverse hasura json depth first
     When hit a leaf field
        If its array type, extract len(array) remote results from the head of remote_results
        If its object type, extract one remote result  from the head of remote_results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant