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

feature: Implement GraphQL response type #3485

Open
calvincestari opened this issue Dec 10, 2024 · 2 comments · May be fixed by apollographql/apollo-ios-dev#558
Open

feature: Implement GraphQL response type #3485

calvincestari opened this issue Dec 10, 2024 · 2 comments · May be fixed by apollographql/apollo-ios-dev#558
Assignees
Labels
networking-stack planned-next Slated to be included in the next release

Comments

@calvincestari
Copy link
Member

This introduces a new media type that would be used for GraphQL responses, see the draft GraphQL over HTTP spec.

It looks like the work should generally be simply:

  1. Modify the accept header to include the new media type signalling to the server that the client can accept responses of that type.
  2. Add application/graphql-response+json to any content-type validation we do before parsing a server response.
  3. Errors - TBD
@calvincestari calvincestari added networking-stack planned-next Slated to be included in the next release labels Dec 10, 2024
@calvincestari calvincestari added this to the Minor Releases (1.x) milestone Dec 10, 2024
@calvincestari
Copy link
Member Author

@martinbonnin - I think you said something earlier about taking action on errors when the response is of the new type, is that correct?

@calvincestari calvincestari self-assigned this Dec 10, 2024
@martinbonnin
Copy link
Contributor

@calvincestari correct, depends what your behaviour is right now but typically you should throw an error if HTTP code != 200. With the advent of graphql-response+json, these responses can be parsed and exposed to the user instead of throwing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
networking-stack planned-next Slated to be included in the next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants