Giter VIP home page Giter VIP logo

Comments (8)

ZirgVoice avatar ZirgVoice commented on July 3, 2024 1

I then close this issue. I will make an issue in apollo-gateway-rs on the implementation of the optional data field

from pioneer.

d-exclaimation avatar d-exclaimation commented on July 3, 2024

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.

ZirgVoice avatar ZirgVoice commented on July 3, 2024

Yes, that's right.

from pioneer.

d-exclaimation avatar d-exclaimation commented on July 3, 2024

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.

ZirgVoice avatar ZirgVoice commented on July 3, 2024

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.

ZirgVoice avatar ZirgVoice commented on July 3, 2024

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.

d-exclaimation avatar d-exclaimation commented on July 3, 2024

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.

ZirgVoice avatar ZirgVoice commented on July 3, 2024

It would be nice to have a subscription-supported gateway in the Swift language🙂

from pioneer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.