Comments (9)
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...
from apollo-link-rest.
@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.
from apollo-link-rest.
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.
from apollo-link-rest.
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.
from apollo-link-rest.
Hey @fbartho, I've added a PR failing test for you guys to poke around - it is indeed a problem, hope its useful.
from apollo-link-rest.
Looking into the source it seems like the only time that forward
is called to send the operation to the next link is here
.
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).
from apollo-link-rest.
@paulpdaniels Dude, I'd love that. Please do take it on.
Specific hazardous scenarios I want to make sure we support / don't break:
- Nesting
@rest()
inside@rest()
queries with `@export(as:…) in use - Nesting
@rest()
inside server-graphql queries with `@export(as:…) in use - Nesting
@rest()
inside@client
queries - Making sure this doesn't break the Typename Patcher codepaths!
from apollo-link-rest.
export directive doesn't seem to work inside server-graphql queries. I get the following error: Unknown directive "export".
from apollo-link-rest.
@marcelombc it would depend on your server implementation I guess, apollo-server
comes with it out of the box, but I don't think it is required to be spec compliant.
from apollo-link-rest.
Related Issues (20)
- Fix typo when defining type for bodySerializer on 'bodySerializer' section
- RestLink causes network calls to be executed much later HOT 4
- Is this repo obsolete? HOT 3
- How to batch operations with apollo-link-rest? HOT 4
- Latest possible (0.8.0) release is still in beta with no active changes HOT 5
- TypeError: Cannot read properties of undefined (reading 'selections') HOT 4
- Questions about apollo-link-rest production status HOT 8
- `graphql-anywhere` is unmaintained; how does this impact `apollo-link-rest`? HOT 17
- Use exported variable in POST request body HOT 7
- Can i use DELETE method with request body? HOT 1
- Conditionally skip REST calls HOT 8
- Apollo Link Rest - MockProvider HOT 1
- Apollo return same data even datatype and url is changed through variables HOT 1
- **Urgent**: Lost Maintainer/Collaborator Access HOT 3
- How to limit the number of items of nested array? HOT 2
- Unable to access context value in the graphql query
- Feature Proposal - RestLink chains HOT 1
- Dependency Dashboard
- data and error fields in useQuery hook empty.
- Can only the remaining uncached links be retrieved? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apollo-link-rest.