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

Added Graph QL Support #244

Closed
wants to merge 2 commits into from
Closed

Conversation

BrawlerXull
Copy link
Contributor

PR Description

Added GraphQL Support to the Application

Related Issues

Checklist

  • I have gone through the contributing guide
  • I have run the tests (flutter test) and all tests are passing

Added/updated tests?

We encourage you to add relevant test cases.

  • Yes
  • No, and this is why: Waiting for maintainers review so that I may add testcases
  • I need help with writing tests

@BrawlerXull
Copy link
Contributor Author

BrawlerXull commented Mar 2, 2024

Screen.Recording.2024-03-03.at.2.17.04.AM.mov

@ashitaprasad @animator I've added graphql support this is the working video of the prototype there are many bugs yet to be fixed!
I wanted a review of weather my approach is correct or not?

@ashitaprasad ashitaprasad changed the title Added Graoh QL Support Added Graph QL Support Mar 3, 2024

enum RequestItemMenuOption { edit, delete, duplicate }

enum HTTPVerb { get, head, post, put, patch, delete }
enum HTTPVerb { get, head, post, put, patch, delete , graphql }
Copy link
Contributor

Choose a reason for hiding this comment

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

GraphQL operates over HTTP, it doesn’t map directly to HTTP verbs like a RESTful service does. GraphQL, on the other hand, is a query language and data manipulation language for APIs.

@@ -255,6 +256,7 @@ const kMethodsWithBody = [
HTTPVerb.put,
HTTPVerb.patch,
HTTPVerb.delete,
HTTPVerb.graphql,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment that I left in the code above. Instead, you can define a ProtocolType enumeration and include HTTP and GraphQL.

Copy link
Contributor

Choose a reason for hiding this comment

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

A separate service file must be made for GraphQL instead of modifying this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for giving the info!
I was also wondering the same :)
I wanted to ask if the logic of implementation
String requestBody = '{"query": "${body!.replaceAll('\n', '')}"}'; is correct and the UI design is on the point
Is there's a suggestion on that I would love to work on it and solve the bugs :)

@opxdelwin
Copy link
Contributor

@BrawlerXull , The implementation looks good, but why did you put GRAPHQL as request type in url endpoint, as mentioned by @mmjsmohit ?

Such a HTTP method doesn't exist. It'd be better if you could put GRAPHQL into body type, as implemented by Postman

@BrawlerXull
Copy link
Contributor Author

Such

Yes! as mentioned earlier I was also thinking that adding it in HTTP method is incorrect 😄
I just wanted to have a review on implementation so that I can move further with a create vision of implementation and the design of the application

Thanks for the review @opxdelwin @mmjsmohit

@BrawlerXull
Copy link
Contributor Author

BrawlerXull commented Mar 3, 2024

1 design I thought was implementing a sperate page like Requests for GraphQL / We can add a button below Requests in the left top side of the application
I would love to hear maintainer's take on this! 😄

@opxdelwin
Copy link
Contributor

But wouldn't that take GraphQL side of requests into an entire separate side? It'd feel like QL developers are different than the rest... My preference would be one implemented by Postman as the image above.
End of the day, GraphQL's body is different, using the same POST method, right?

@animator
Copy link
Member

@BrawlerXull Please make this change #307

@animator
Copy link
Member

animator commented Mar 21, 2024

Handling GraphQL API is different from REST HTTP API and the current approach needs a lot of rework along with using graphQL helper packages.
Closing this PR. Please read more about GraphQL, review the approach and raise a new PR.

@animator animator closed this Mar 21, 2024
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.

Add GraphQL Support
5 participants