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

WIP: createBatchOperation() #709

Closed
wants to merge 2 commits into from
Closed

WIP: createBatchOperation() #709

wants to merge 2 commits into from

Conversation

mfix22
Copy link
Contributor

@mfix22 mfix22 commented Apr 3, 2018

New createBatchOperation() API

This would not only let users delegate to multiple roots at once (with aliasing), but also create a batched operation to send directly to downstream remoteSchemas (using toPromise(execute(link, operation)) for example)

  • delegateToSchema() and createDocument() use createBatchOperation
    to ensure tests pass w/ either
    • Let me know if you want me to revert those changes. It was more an exercise to see if I cover all the current tests before writing more tests

CC: @freiksenet, @stubailo

Mike Fix added 2 commits April 3, 2018 11:20
    - delegateToSchema() and createDocument() use createBatchOperation
      to ensure tests pass w/ either
    - [ ] TODO: overlapping fragments fail
@mfix22
Copy link
Contributor Author

mfix22 commented Apr 3, 2018

Also i know the new API is landing soon, so I can definitely refactor this to work with the new API if need be. Just thought I would toss up my progress sooner rather than later.

@freiksenet
Copy link
Contributor

This is cool. 👍

I think this will also enable using data loader with delegateToSchema, as createBatchOperation can be used as a batch operation.

I wonder if you could rebase it on top of next-api, I think it's gonna be merged very soon and I feel we should base the work on that.

@mfix22
Copy link
Contributor Author

mfix22 commented Apr 5, 2018

Sounds good. I'll try and rebase off of next-api.

Totally! There are tons of batching type updates we can work on separate to this too, like for example collecting up fields such that only one fetch to a remote schema is made per request cycle (instead of one per root) (:

@freiksenet
Copy link
Contributor

Closing in favor of #724

@freiksenet freiksenet closed this Apr 17, 2018
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.

None yet

2 participants