aws / aws-appsync-community

The AWS AppSync community
https://aws.amazon.com/appsync
Apache License 2.0
507 stars 32 forks source link

Feature Request - Metadata in AppSync Response #123

Open denniscmpe opened 4 years ago

denniscmpe commented 4 years ago

Please also add the ability to add metadata to the AppSync response. This is currently available as GraphQL extensions:

1) https://github.com/graphql-dotnet/graphql-dotnet/issues/912 2) https://github.com/graphql/express-graphql#providing-extensions

EmiiFont commented 3 years ago

updates on this?

alevantana commented 5 months ago

This feature would be very beneficial when GraphQL API consumers are not it's developers (they don't have access to AWS tooling). Then exposing some performance or underlying calls metadata would aid debugging and creating more efficient queries. Currently errors are mapped using $util.error() in VTL. Maybe a similar util could be implemented for the extensions: $util.extensions()? It seems in theory it's possible to return structure { data: {}, extensions: {}} manually in simple cases. But if you want to map this data to GraphQL fields, you're mapping inner contents of data and there is no way to expose extensions.