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

Pass variables from high level graph to low-level level one #42

Open
vharitonsky opened this issue Aug 16, 2018 · 0 comments
Open

Pass variables from high level graph to low-level level one #42

vharitonsky opened this issue Aug 16, 2018 · 0 comments

Comments

@vharitonsky
Copy link

If low-level graph field is accepting options for entity filter, there should a possibility to pass the variables down from top level graph. This will allow to avoid unnecessary query and optimize db queries.
Example:
High level graph:

Field('regionName', String, company_sg.c(
            get_company_region(
                S.this.address,
                each(S.branch, S.this.branches, S.branch.address.region_id),
                S.regionId
            )
        ), options=[Option('regionId', Optional[Integer], default=None)]),

This field uses region as a way to filter branches on the client side. If we could pass the variable, we could filter them server side limiting the amount of entities we need to process to zero in most common cases

Field('regionName', String, company_sg.c(
            get_company_region(
                S.this.address,
                each(S.branch, S.this.branches(S.regionId), S.branch.address.region_id),
                S.regionId
            )
        ), options=[Option('regionId', Optional[Integer], default=None)]),
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