Comments (8)
I then close this issue. I will make an issue in apollo-gateway-rs on the implementation of the optional data field
from pioneer.
So on errors with no data, the data
property in the JSON response should always be set to null
or is it the other around?
In either case, GraphQLResult is part of GraphQL so it probably need to be implemented there, but I can probably make a PR for this.
from pioneer.
Yes, that's right.
from pioneer.
Can I ask what gateway are you using?
I checked what data
property should be with the GraphQL spec laid out here. The present of the data
property must not exist if the error comes before the execution but must exist after, so it may or may not exist in the response depending on the scenario. It wouldn't make sense to change the implementation to have data
property to always be null
and not follow the spec here.
I can instead fix the GraphQLResult type to have a way to explicitly specify where to have data
as null or excluded, but I am not sure this would fix the issue with the gateway not recognising errors if the data
is excluded in the response.
Or, would it make more sense have option in Pioneer to go out of the spec and have data
should always be included if really necessary?
from pioneer.
I've been looking for a long time for a gateway that works with subscriptions. I settled on this https://github.com/K0R0VA/apollo-gateway-rs. Its data field is not optional. I know Apollo Router supports subscription now, but they have this feature as part of their Enterprise plan.
from pioneer.
At the moment I use Middleware to pass null in the data field in case of error, but to do that I have to decode each response in GraphQLResult, it really slows down the work, especially when the response has a lot of data.
from pioneer.
Hmm, I see. Honestly, I am unsure about making the decision to change the data
property at Pioneer's level.
I think opening an issue about this in GraphQL would be best and letting GraphQLSwift maintainers decide on how to resolve this issue.
I would also open an issue on apollo-gateway-rs about this, I am bit confused on why they doesn't accept data
as optional field.
from pioneer.
It would be nice to have a subscription-supported gateway in the Swift language🙂
from pioneer.
Related Issues (20)
- Public structs have no public initialisers
- After pausing the websocket connection from Apollo iOS, it can't reconnect. HOT 12
- Documentation search is pointing to incorrect path HOT 2
- Better typing for payload HOT 1
- Improvement to Test HOT 1
- Improvement to optional spec-compliant HOT 4
- Field Resolve Middleware HOT 1
- VaporMiddleware responding incorrectly to all paths HOT 7
- Plugins
- Error: 'ConcurrentResolve' is only available in macOS 12 or newer HOT 4
- TestConsumer Improvement
- subscription Precondition failed HOT 13
- Subscription via gateway HOT 3
- Improvement to spec-compliant HOT 1
- GraphQL together with gRPC HOT 4
- Support for the new Swift Universal HTTP types
- Does Pioneer support multiplexing subscriptions over one WebSocket connection? HOT 6
- Does Pioneer support subscriptions via SSE? HOT 2
- `websocketOnInit` has not been implemented
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 pioneer.