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

defer stream support within stitching #1941

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open

defer stream support within stitching #1941

wants to merge 49 commits into from

Commits on May 29, 2021

  1. Configuration menu
    Copy the full SHA
    5b7320e View commit details
    Browse the repository at this point in the history
  2. add changeset

    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    6362145 View commit details
    Browse the repository at this point in the history
  3. update delegate to support defer/stream

    - delegateToSchema stores a Receiver object within any returned ExternalObject. The Receiver manages the incoming AsyncIterable payloads and any requests for as yet unretrieved data.
    
    - use new type merging algorithm that lazily merges fields from additional subschemas as needed at field resolution time.
    
    - add __typename to all selection sets, but only once, needed because any type with deferred fields requires __typename
    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    3ba3682 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    bb8b612 View commit details
    Browse the repository at this point in the history
  5. update types

    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    ae1e1f6 View commit details
    Browse the repository at this point in the history
  6. Update mock package

    Just a types update
    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    1b0f8fa View commit details
    Browse the repository at this point in the history
  7. Update stitch package

    Precompile selection set hints into arrays of field nodes
    
    Dynamic selectionSet hints therefore now return an array of field nodes instead of a selectionSet!
    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    97ae0e7 View commit details
    Browse the repository at this point in the history
  8. remove dead code

    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    97e8e39 View commit details
    Browse the repository at this point in the history
  9. format WrapFields transform

    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    bc5988e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    04bcba5 View commit details
    Browse the repository at this point in the history
  11. generateProxyingResolvers should optionally take a transformedSchema …

    …so that wrapSchema can be aware of the transformedSchema
    
    stitchSchemas was previously aware of this via StitchingInfo
    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    09d1b30 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    29f67e3 View commit details
    Browse the repository at this point in the history
  13. update tests with __typename

    now that it is added everywhere
    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    0f8c63c View commit details
    Browse the repository at this point in the history
  14. update batch-execute package

    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    f26739b View commit details
    Browse the repository at this point in the history
  15. remove dead type

    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    9a4ce1a View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    aee792c View commit details
    Browse the repository at this point in the history
  17. refactor split

    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    2874c6c View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    3531495 View commit details
    Browse the repository at this point in the history
  19. remove unnecessary casts

    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    a9e946d View commit details
    Browse the repository at this point in the history
  20. add missing dependency

    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    6609312 View commit details
    Browse the repository at this point in the history
  21. fix(types): a little

    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    0d6fe49 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    c50a819 View commit details
    Browse the repository at this point in the history
  23. when possible, update the receiver synchronously rather than requesti…

    …ng data from it
    
    not sure why (yet?), but it also helps some tests pass
    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    336a410 View commit details
    Browse the repository at this point in the history
  24. fix split

    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    cbb303c View commit details
    Browse the repository at this point in the history
  25. remove logged payloads

    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    c083600 View commit details
    Browse the repository at this point in the history
  26. implement mapAsyncIterator with repeaters

     Implementation adapted from: repeaterjs/repeater#48 (comment) so that all payloads will be delivered in the original order
    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    30533c6 View commit details
    Browse the repository at this point in the history
  27. rename split

    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    b46a255 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    1c9e321 View commit details
    Browse the repository at this point in the history
  29. fix rebase

    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    5dd17dd View commit details
    Browse the repository at this point in the history
  30. further refactor

    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    83103bc View commit details
    Browse the repository at this point in the history
  31. rename info => parentInfo

    for consistency
    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    ec4440f View commit details
    Browse the repository at this point in the history
  32. change Receiver to emit graphql results instead of external objects

    WIP, now emits results with merged errors, plan to emit plain results
    
    goal: create receivers that can be more easily modified for batching
    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    e9e11d9 View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    1faddee View commit details
    Browse the repository at this point in the history
  34. refactor =>

    change resolveExternalValue => createExternalValue
    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    2153fb0 View commit details
    Browse the repository at this point in the history
  35. no longer necessary because createExternalObject creates a new object…

    … rather than annotating
    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    ec352cf View commit details
    Browse the repository at this point in the history
  36. append base path to errors only when creating external values

    this removes this logic from the receiver, which will help receiver proxying
    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    5bd77cb View commit details
    Browse the repository at this point in the history
  37. stitch new base paths to errors only when creating leaf external valu…

    …es, this allows the merged results to be agnostic of stitched base paths, and enables implementing batching of merged results irrespective of possible changes to the base paths
    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    e84adb8 View commit details
    Browse the repository at this point in the history
  38. pare down receiver algorithm

    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    826e84b View commit details
    Browse the repository at this point in the history
  39. simplify

    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    0fcfc4f View commit details
    Browse the repository at this point in the history
  40. Reproduction test case

    mjbcopland authored and yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    b18c428 View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    cfaea06 View commit details
    Browse the repository at this point in the history
  42. inline delegation into batch-delegate

    to make some better magic
    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    c004429 View commit details
    Browse the repository at this point in the history
  43. add TODOs

    by splitting prior to externalValue creation we will be able to use the correct info
    yaacovCR committed May 29, 2021
    Configuration menu
    Copy the full SHA
    489c9bf View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2021

  1. Receiver refactor

    We may end up having one type of Receiver
    Receivers can also return external values not just MergedExecutionResults, even if the cache is of MergedExecutionsResults
    yaacovCR committed Jun 1, 2021
    Configuration menu
    Copy the full SHA
    99bda2d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    df69614 View commit details
    Browse the repository at this point in the history
  3. Receiver does not have to transform results

    It can be passed a stream of transformedResults using mapAsyncIterator
    
    note that using `break` in for await(...of...) causes abrupt completion and will return the iterator, not really sure why this became a problem only when mapping the iterator
    yaacovCR committed Jun 1, 2021
    Configuration menu
    Copy the full SHA
    97c0328 View commit details
    Browse the repository at this point in the history
  4. refactor batchDelegateToSchema

    ...to use DataLoader for the actual GraphQL results, rather than the external values
    
    This allows us to properly transduce streams.
    
    TODO:
    1. We should now be able to add the stream directive for batchDelegateToSchema.
    2. Refactor error parsing, now we are relying on the onLocatedError option, but this
       is no longer necessary. Note that additional tests for batched errors are now passing
       (see #2951)
    3. Bring back createBatchDelegateFn, that may be useful
    4. The Receiver is now created separately for each list item, which means that the
       initialPathDepth probably does not match? This will require a separate argument to
       the Receiver constructor for adjustment
    5. Bring back valuesFromResults and fix documentation, we now operate on GraphQL
       results, so should be fewer pitfalls (see #2829)
    yaacovCR committed Jun 1, 2021
    Configuration menu
    Copy the full SHA
    b844c3e View commit details
    Browse the repository at this point in the history
  5. fix types for now

    try to avoid breaking changes (in the future?)
    yaacovCR committed Jun 1, 2021
    Configuration menu
    Copy the full SHA
    8aac856 View commit details
    Browse the repository at this point in the history
  6. add polyfill back

    yaacovCR committed Jun 1, 2021
    Configuration menu
    Copy the full SHA
    3a079fc View commit details
    Browse the repository at this point in the history