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

Improve transaction list for GraphQL requests #805

Merged
merged 11 commits into from
Sep 10, 2022
Merged

Improve transaction list for GraphQL requests #805

merged 11 commits into from
Sep 10, 2022

Conversation

Canato
Copy link
Contributor

@Canato Canato commented Apr 21, 2022

Close #69
Close #116

πŸŽ₯ Video

SVID_20220421_011146_1.mp4

πŸ“· Image

after iterative improvement

πŸ“„ Context

Based on #69, #116 and a little on #579 we have a desire for a more clean list when using GraphQL.
This helps to debug who uses Graphql without changing normal okhttp requests

πŸ“ Changes

Retrieve request header for transaction list and display it if is a GraphQl request and have the operationName

πŸ› οΈ How to test

On the Sample code, there is a new button Do GraphQl Activity that can be pressed for testing.

⏱️ Next steps

Wanna be sure the code I add is following the library standards, open to suggestions!

@Canato
Copy link
Contributor Author

Canato commented Apr 21, 2022

Great library people, hope this is useful and we can release it soon
@cortinico @MiSikora @olivierperez @vbuberen

@cortinico
Copy link
Member

Hey @Canato,
Have you seen the PR at #800?
I'd like to coordinate between the two to make sure we merge only one of the two approach.

@Canato
Copy link
Contributor Author

Canato commented May 3, 2022

Hey @Canato, Have you seen the PR at #800? I'd like to coordinate between the two to make sure we merge only one of the two approach.

Ohh @cortinico Thanks! I saw #70 because I come from the issue, but didn't spot #800 when I start to do these changes!

I'm happy to move with 800 if @alkber wanna fix the issues open there. I'm happy to close this one.

From another point of view, my implementation is a simple one and since the tests passed(if the code is valid) we could merge and use the 800 as an iterative improvement.
I was already planning to return with more requests/tests/icons, but I believe we should have small PRs and do them in small batches.

I see that my sample implementation differs from the other PR too because I'm using a real schema from the guides, would be interesting to know what will be the best solution.

That said, any of the solutions work for me if we can put them to work =D. Let me know @alkber

@alkber
Copy link

alkber commented May 4, 2022

Hey @Canato, Have you seen the PR at #800? I'd like to coordinate between the two to make sure we merge only one of the two approach.

Ohh @cortinico Thanks! I saw #70 because I come from the issue, but didn't spot #800 when I start to do these changes!

I'm happy to move with 800 if @alkber wanna fix the issues open there. I'm happy to close this one.

From another point of view, my implementation is a simple one and since the tests passed(if the code is valid) we could merge and use the 800 as an iterative improvement. I was already planning to return with more requests/tests/icons, but I believe we should have small PRs and do them in small batches.

I see that my sample implementation differs from the other PR too because I'm using a real schema from the guides, would be interesting to know what will be the best solution.

That said, any of the solutions work for me if we can put them to work =D. Let me know @alkber

Hi @cortinico , isorry i was really busy with personal work and couldn't address the comments in PR #800. I believe @Canato approach is more generic and neat than mine as i read the code, and he has decorated the PR with more test cases too.. You may close PR #800 and use this one. However I have a small suggestion, to @Canato PR. If the UI item can be updated to the way PR #800 does then it would be much appreciated and visually appealing. @Canato can you take it up? you can reuse my work in your code.

@Canato
Copy link
Contributor Author

Canato commented May 4, 2022

If @cortinico is ok I can update the UI to use the graphql icon and add a new line ^^. Thanks @alkber

@Canato
Copy link
Contributor Author

Canato commented May 20, 2022

@cortinico news on this? =D

@Canato
Copy link
Contributor Author

Canato commented Jun 1, 2022

Add the GraphQL icon and new field for it.

Copy link
Member

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff! Thanks for doing this. Sorry for the late review πŸ™
Let me know if you need some help integrating the changes I suggested

@@ -0,0 +1,9 @@
./gradlew downloadApolloSchema --endpoint="https://rickandmortyapi.com/graphql" --schema="sample/src/main/graphql/com/chuckerteam/chucker/sample/schema.json"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a #!/bin/bash on top

downloadApolloSchema.sh Show resolved Hide resolved
downloadApolloSchema.sh Outdated Show resolved Hide resolved
downloadApolloSchema.sh Outdated Show resolved Hide resolved
@Canato Canato requested a review from cortinico June 6, 2022 12:17
@@ -53,7 +53,8 @@ internal class HttpTransaction(
@ColumnInfo(name = "responseHeadersSize") var responseHeadersSize: Long?,
@ColumnInfo(name = "responseBody") var responseBody: String?,
@ColumnInfo(name = "isResponseBodyEncoded") var isResponseBodyEncoded: Boolean = false,
@ColumnInfo(name = "responseImageData") var responseImageData: ByteArray?
@ColumnInfo(name = "responseImageData") var responseImageData: ByteArray?,
@ColumnInfo(name = "graphQlOperationName") var graphQlOperationName: String?,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, but wouldn't we need to include a check for this parameter in the fun hasTheSameContent()?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, I've added it πŸ‘

@Canato
Copy link
Contributor Author

Canato commented Sep 1, 2022

Any news on this? Worth to solve the conflicts ?

@vbuberen
Copy link
Collaborator

vbuberen commented Sep 8, 2022

Any news on this? Worth to solve the conflicts ?

Yes, worth solving. Let's make it happen.

Copy link
Member

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've rebased your changes @Canato and fixed the detekt failures πŸ‘ This is good to merge on my end.

@cortinico cortinico merged commit 0e18ea6 into ChuckerTeam:develop Sep 10, 2022
@Canato
Copy link
Contributor Author

Canato commented Sep 12, 2022

Thanks @cortinico how do we know when will be the next release or if this will be available in a snapshot?

@cortinico
Copy link
Member

No sorry we don't have an ETA at the moment. I'm looking into wrapping up the work for a 4.x.
We probably want to include the #259 work which will take some time to do (as it hasn't started yet). In the meanwhile you can use the SNAPSHOT versions for 4.x

@Canato
Copy link
Contributor Author

Canato commented Sep 13, 2022

No issues, Thanks! =D

alifernandez45

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Additional GraphQL Support Add support for GraphQL
7 participants