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

Add GraphQL Support #117

Open
ashitaprasad opened this issue Feb 21, 2024 · 11 comments · May be fixed by #518
Open

Add GraphQL Support #117

ashitaprasad opened this issue Feb 21, 2024 · 11 comments · May be fixed by #518
Labels
enhancement New feature or request good first issue Good for newcomers priority: high

Comments

@ashitaprasad
Copy link
Member

Tell us about the task you want to perform and are unable to do so because the feature is not available
GraphQL, a query language for APIs and a runtime for executing those queries, has gained popularity due to its flexibility and efficiency in fetching data. Testing GraphQL APIs is critical for validating schema consistency, query correctness & error handling. By providing support for testing, visualization & integration code generation of GraphQL APIs, we can ensure their quality and reliability.

@ashitaprasad ashitaprasad added enhancement New feature or request good first issue Good for newcomers labels Feb 21, 2024
@An-Yay
Copy link

An-Yay commented Feb 26, 2024

Hey I'd like to have a take on implementing it from scratch. What would be the basic outlines or timeline you'd like me to follow for the same? I'm familiar with graphql and flutter.

For now I can start with getting familiar with other services and their implementations

@animator
Copy link
Member

@An-Yay You can start as soon as possible and share your design and your approach on this thread.

@An-Yay
Copy link

An-Yay commented Feb 26, 2024

Alright, I'll get started with it tonight. Any suggestions or things that I should consider for the design?
Please assign the same if it's possible

@An-Yay
Copy link

An-Yay commented Feb 26, 2024

For the GraphQL testing we can add in another button right below Requests button with the same layout for entering the API endpoint. Below that in the requests section, user would be able to give new parameters, handle Auth, add Headers, add QUERY, graphql variables and see the response below. Further we can add some settings for the API testings, handling redirects, make strict parsing, add website specific cookies and so on.
I am interested in doing the same under GSOC. I'll try creating a mockup on figma to showcase the actual idea in design. Please provide me with any further feedback on the same.

@animator
Copy link
Member

@An-Yay You can draw a mockup of design and share here.

@BrawlerXull BrawlerXull mentioned this issue Mar 2, 2024
5 tasks
@BrawlerXull
Copy link
Contributor

BrawlerXull commented Mar 2, 2024

@An-Yay You can draw a mockup of design and share here.

I've tried implementing it in #244 please review the design/code

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

@Clasherzz
Copy link
Contributor

Clasherzz commented Dec 7, 2024

I have a doubt regarding this issue @ashitaprasad
#307 (comment).

Also if GraphQL is being implemented that might mean changing the http_services.dart(or using another package) but according to an earlier cnversation #486 (comment) there is a migration from http to dio. So how would the organization look forward on the workflow.(The dio transition is currently not a priority in your roadmap).

@Clasherzz
Copy link
Contributor

Clasherzz commented Dec 15, 2024

@ashitaprasad Layout for GraphQL Approach
apidash1

The graphQL client supports headers , sending of the query. 2 tabs shown (to enter graphql query and to enter values of variables used on that graphql) only when GraphQL is selected on drop box. Both of this are written in json like format.
The output contains status code , time differences , the entire output as a json format. (Not seperated as errors , data etc.)

There would be helpers to ensure both the variables and queries are written in proper format which would be written later in the code.After ensuring the approach is correct

Proposing to use grapghql client library https://pub.dev/packages/graphql.

Please let me know if there is anything to add or anything i got wrong.

@ashitaprasad
Copy link
Member Author

@Clasherzz What is the rationale behind choosing graphql package and not any other library present in https://fluttergems.dev/graph-query-language/ ?

@Clasherzz
Copy link
Contributor

Clasherzz commented Dec 15, 2024

@ashitaprasad I usually choose packages based on pub points and satisfaction rate . The graphql client i recommended stands at the top in this metric . The only one above it is graphql_flutter which is actually produced by the same company but for making widgets that suports graphql queries(not something we need). The rest of the clients i saw are not really popular and rather upcoming. I worked on the client and send a couple of queries and found it comfortable to work with. Apart from that the usage of it in popular project like freecodecamp boosted my confidence.

Ferry is also a good choice .It gives you a choice of disabling garbage collector for certain objects. But i didnt find any need of that in this project. And not to mention it is not as popular according to stats.

Most of the other ones in fluttergems search you shared doesnt have client functionality.

So at the end of the day I chose this package cause its way more established and supported. I felt comfortable using it and was confident it could integrate well into the existing code.

@ashitaprasad
Copy link
Member Author

Sounds good @Clasherzz .. looking forward to your PR 👍

@Clasherzz Clasherzz linked a pull request Dec 27, 2024 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers priority: high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants