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

support extensions to graphql response #48

Open
a8t3r opened this issue Jan 26, 2025 · 0 comments
Open

support extensions to graphql response #48

a8t3r opened this issue Jan 26, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@a8t3r
Copy link
Contributor

a8t3r commented Jan 26, 2025

https://graphql.org/learn/response/#extensions
https://smallrye.io/smallrye-graphql/1.9.3/extensions/
https://smallrye.io/smallrye-graphql/1.9.3/custom-error-extensions/

The final top-level key allowed by the GraphQL specification in a response is the extentions key. This key is reserved for GraphQL implementations to provide additional information about the response and though it must be an object if present, there are no other restrictions on what it may contain.

{
  "data": {
    "superHero": {
      "name": "Wolverine",
      "location": null
    }
  },
  "errors": [{
    "message":"location unknown",
    "path": ["superHero","location"],
    "extensions":{"code":"location-unknown"}
  }]
}
{
  "data": {
    "shirt": {
      "size": "L"
    }
  },
  "extensions": {
    "country": "Germany",
    "pi": 3.1415926535
  }
}
@ermadmi78 ermadmi78 added the enhancement New feature or request label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants