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

Batch import of facilities from CSV #52

Open
anibalsolon opened this issue Apr 16, 2018 · 1 comment
Open

Batch import of facilities from CSV #52

anibalsolon opened this issue Apr 16, 2018 · 1 comment
Assignees

Comments

@anibalsolon
Copy link
Member

Import a CSV file containing one facility per line, that matches a provided template.

The interface flow should be:

  1. A drop place or a file selector, to upload the file (using e.g. https://github.com/react-dropzone/react-dropzone)
  2. Load and parse CSV using the HMTL5 File API: https://developer.mozilla.org/en-US/docs/Web/API/File/Using_files_from_web_applications
  3. Check if it matches with the template
  4. Check for invalid values (e.g. GPS position out of range)
  5. Provide a data table for user checking
  6. For each table line, execute the addFacility mutation, storing the response to show the user
  7. Show progress bar
@anibalsolon
Copy link
Member Author

About item #6 :

Since the mutation addFacility will be executed 20x for a CSV with 20 lines, it should be better to group them into one single HTTP request, instead of 20 requests.

To address this scenario, Apollo provides a batcher, that will group operations executed quasi-simultaneously. It groups operations in a default range of 10ms. It can be changed using the batchInterval option.

https://www.apollographql.com/docs/link/links/batch-http.html

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

No branches or pull requests

2 participants