sentry-dart icon indicating copy to clipboard operation
sentry-dart copied to clipboard

Support `graphql` APM/Breadcrumbs

Open marandaneto opened this issue 3 years ago • 7 comments

Description

https://pub.dev/packages/graphql_flutter https://pub.dev/packages/graphql https://pub.dev/documentation/graphql/latest/graphql/QueryResult-class.html https://pub.dev/documentation/graphql/latest/graphql/GraphQLClient-class.html Example https://github.com/ueman/sentry-dart-tools/tree/main/sentry_graphql

marandaneto avatar Nov 10 '22 14:11 marandaneto

Actually, the better example is sentry_link. sentry_graphql (permalink to before deletion) doesn't really add value over the link integrations and I've deleted it since. The link integration is also more versatile, since it integrates into a couple different GraphQL clients as mentioned in it's readme.

I'm also open to transfer ownership of the https://pub.dev/packages/sentry_link package, if there's interest.

ueman avatar Nov 10 '22 14:11 ueman

https://github.com/DiederikvandenB/apollo-link-sentry also uses the Link approach for RN, so using the Link approach would be the way to go.

marandaneto avatar Jan 16 '23 12:01 marandaneto

Worth checking this discussion before tackling this issue.

marandaneto avatar Jan 16 '23 15:01 marandaneto

Also, this https://github.com/getsentry/sentry/issues/33723 issue, but I don't think it will be tackled soon.

ueman avatar Jan 17 '23 07:01 ueman

I'll drop Client errors for now unless it throws an exception.

Unlike REST APIs, GraphQL servers don’t use HTTP status codes to indicate unsuccessful requests. Instead, the GraphQL response body includes an array of errors when an operation fails.

The SDK would need to read and deserialize the payload, we'd need to decide if we actually wanna do it and if the response payload is standardized across different Graph implementations.

marandaneto avatar Jan 17 '23 10:01 marandaneto

The SDK would need to read and deserialize the payload, we'd need to decide if we actually wanna do it and if the response payload is standardized across different Graph implementations.

An additional problem is, that you can have partial errors with GraphQL. The error response is standardized, as seen here.

ueman avatar Jan 17 '23 10:01 ueman