-
Notifications
You must be signed in to change notification settings - Fork 8
Add response error graphql properties #308
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| { | ||
| "type": "resource", | ||
| "date": 1591284175328, | ||
| "application": { | ||
| "id": "ac8218cf-498b-4d33-bd44-151095959547" | ||
| }, | ||
| "session": { | ||
| "id": "cacbf45c-3a05-48ce-b066-d76349460599", | ||
| "type": "user" | ||
| }, | ||
| "source": "browser", | ||
| "view": { | ||
| "id": "623d50fd-75cf-4025-97d2-e51ff94171f6", | ||
| "referrer": "", | ||
| "url": "https://app.datadoghq.com/rum/explorer?live=1h&query=&tab=view" | ||
| }, | ||
| "resource": { | ||
| "id": "b83a5d82-cdd1-468d-9bc9-3aa9e54d957a", | ||
| "type": "fetch", | ||
| "method": "POST", | ||
| "url": "https://api.example.com/graphql", | ||
| "status_code": 200, | ||
| "duration": 246580000, | ||
| "size": 3599, | ||
| "encoded_body_size": 1599, | ||
| "decoded_body_size": 3599, | ||
| "transfer_size": 3699, | ||
| "render_blocking_status": "non-blocking", | ||
| "protocol": "HTTP/1.1", | ||
| "delivery_type": "cache", | ||
| "graphql": { | ||
| "operationType": "query", | ||
| "operationName": "GetUserProfile", | ||
| "variables": "{\"userId\": \"123\"}", | ||
| "payload": "query GetUserProfile($userId: ID!) { user(id: $userId) { name email } }", | ||
| "error_count": 2, | ||
| "errors": [ | ||
| { | ||
| "message": "User not found", | ||
| "code": "USER_NOT_FOUND", | ||
| "locations": [ | ||
| { | ||
| "line": 1, | ||
| "column": 15 | ||
| } | ||
| ], | ||
| "path": ["user", 1] | ||
| }, | ||
| { | ||
| "message": "Invalid email format", | ||
| "code": "INVALID_EMAIL", | ||
| "locations": [ | ||
| { | ||
| "line": 1, | ||
| "column": 25 | ||
| } | ||
| ], | ||
| "path": ["user", "email"] | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "action": { | ||
| "id": "ae3a5d82-cdd1-468d-9bc9-3aa9e54d953c" | ||
| }, | ||
| "_dd": { | ||
| "format_version": 2, | ||
| "span_id": "12345", | ||
| "parent_span_id": "67890", | ||
| "trace_id": "7890" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rgaignault Question.
What does this
pathmean? Is it ok that it is an array of either strings or numbers? Are you sure everything is correct here?Asking because for Android our json parser generator fails to process this and I want to know if I need to fix it (add support of
oneOf(primitive types)).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @aleksandr-gringauz ! Based on the spec, that's what I have : https://github.com/graphql/graphql-spec/blob/main/spec/Section%207%20--%20Response.md.
Also based on the examples it's either integer or string. Do you see an other way of declaring this ?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reply @rgaignault!
For me the following option will work. Checked it in
dd-sdk-android.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with Kotlin is that we don't have
String | Integerlike typescript. We only havesealed classes, for example:If I were to try to implement
String | IntegerI would have to generate something like:And if
oneOf(string|int)occurs multiple times in the schema, I would have to make differentStringOrIntfor them or somehow reuse a common one.It all requires some work on the generator which I would like to avoid if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed with @maxep about how they do on iOS. I might implement similar solution on Android, but need more time to think.
For now, no action is needed from your side. Thanks!