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

bulk areas query #451

Merged
merged 1 commit into from
Mar 5, 2025
Merged

bulk areas query #451

merged 1 commit into from
Mar 5, 2025

Conversation

vnugent
Copy link
Contributor

@vnugent vnugent commented Feb 26, 2025

Issue #442

  • New query bulkAreas(ancestors: string[]): AreaType[] to get all areas with a common ancestor path. ancestors is an array of area uuid's starting from the country root node, which is same as an area ancestors field.
  • Max payload is hard coded at 10MB. I haven't tested querying some of the largest states (Colorado, CA, Utah) with all the usual fields.

In this example, we're getting Arizona and its descendants, another word any areas with ancestors starting with USA / Arizona.

Screenshot 2025-02-26 at 6 07 23 PM

@Vichy97 would something like this work?

@Vichy97
Copy link
Collaborator

Vichy97 commented Feb 26, 2025

This would work, but is there a reason we can't just pass an area id?

@vnugent
Copy link
Contributor Author

vnugent commented Feb 27, 2025

This would work, but is there a reason we can't just pass an area id?

It's a small performance optimization (one less look up query). I can look up ancestors from area id, but the caller, the mobile app in this case, most likely has ancestors.

@vnugent
Copy link
Contributor Author

vnugent commented Feb 27, 2025

Also, to reduce misuse the call will require the user's API key similar to update mutations.

@Vichy97
Copy link
Collaborator

Vichy97 commented Feb 27, 2025

Ok sounds good. I'll test this out when it lands

@vnugent vnugent merged commit 4a38521 into develop Mar 5, 2025
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants