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
Cannot combine rest w/ graphql in the same query #97
Comments
Hey @chimon2000 -- this sounds like a big bug, do you feel comfortable submitting a unit-test for us that could reproduce this? Alternately, a PR that fixes this would be even better. I'm happy to help, but my current main test environment doesn't use a real GraphQL server, so I'm not quite set up to verify that this is working. |
Hey @fbartho, thanks for the quick response. I added my example repo that contains the code necessary to reproduce the issue with both angular and (p)react examples, but I can see about adding a unit test for this as well. I am not particularly adept with how apollo links work. |
A test for apollographql#97
A test for apollographql#97
Hey @fbartho, I've added a PR failing test for you guys to poke around - it is indeed a problem, hope its useful. |
A test for apollographql#97 Alos added the ``` "testURL": "http://localhost/", ``` to jest config to allow tests to run
Looking into the source it seems like the only time that I think if we want to support the merging behavior we need to inspect the query strip out non-rest pieces and forward them to the next link. I think basically copying this section from apollo-link-state would be sufficient (it might even make sense to coordinate with the maintainers to extract that kind of logic into a separate package since it seems really useful for link builders). |
Actually I just checked and it is already part of apollo-utilities. @fbartho I'd be willing to take this on if no one else is already working on it. Seems like a relatively easy fix. Will need to imagine some various test scenarios though... |
@paulpdaniels Dude, I'd love that. Please do take it on. Specific hazardous scenarios I want to make sure we support / don't break:
|
export directive doesn't seem to work inside server-graphql queries. I get the following error: Unknown directive "export". |
@marcelombc it would depend on your server implementation I guess, |
@paulpdaniels You're right. I'm using graphene on the server and I just needed to create a custom directive to support @export. Thanks for your help. |
Summary
I am attempting to intermingle a rest request with a graphql request. Both requests refer to the same resource and work when executed individually. However, when attempting to execute the two together
I get the following error
You can find the example that I am referring to here
The text was updated successfully, but these errors were encountered: