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

(Fix) Add support for mix mode queries. #138

Merged

Conversation

paulpdaniels
Copy link
Contributor

This PR adds support for mixed mode queries, i.e. queries where there are other non-rest query parts that need to be forwarded to other links. It should support both sibling queries as well as nested queries. Though based on my tests there are some issues (which may not be related to apollo-link-rest) with some advanced use cases e.g. sending an export variable to a second generation nested field across a link boundary,

query {
  authors {
    id @export(as: "authorId")
    recentlyViewedPosts @client {
      id @export(as: "postId")
      # Doesn't seem to resolve the authorId in this case
      post @rest(type: "Post", path: "/posts/{exportVariables.authorId}/{exportVariables.postId}") {
        body
      }
    }
  }
}

@fbartho @ivank

Tests expanded from #137

Fixes #97

@ghost ghost added blocking Prevents production or dev due to perf, bug, build error, etc.. has-reproduction ❤ Has a reproduction in a codesandbox or single minimal repository labels Aug 22, 2018
@fbartho fbartho added this to the v0.5.0 milestone Aug 27, 2018
@fbartho fbartho mentioned this pull request Aug 27, 2018
@paulpdaniels
Copy link
Contributor Author

@fbartho any idea why the tests pass, but the compile fails?

@fbartho
Copy link
Collaborator

fbartho commented Sep 16, 2018

@paulpdaniels Some mess around rollup / npm build process causes some duplicate shit in a nested node_modules, I forget what the exact cause is, but I've found it's nothing to worry about, and I can resolve it when building to deploy.

Sorry it took me so long to get back to this PR. I'm out of crunch, and back from vacation, and landing this now, and deploying these changes soon! Thanks for your contributions.

I'd love to get a fix for that issue eventually, but I think we might need @hwillson to give us a hand.

@fbartho fbartho merged commit 8dc1f43 into apollographql:master Sep 16, 2018
@paulpdaniels paulpdaniels deleted the support-mixed-mode-resolution branch April 28, 2021 08:55
hyperNURb added a commit to hyperNURb/apollo-link-rest that referenced this pull request Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocking Prevents production or dev due to perf, bug, build error, etc.. has-reproduction ❤ Has a reproduction in a codesandbox or single minimal repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot combine rest w/ graphql in the same query
2 participants