-
Notifications
You must be signed in to change notification settings - Fork 9
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
Support string queries #1
Comments
Thanks for your issue. This basic PoC is really inspired by https://github.com/shurcooL/githubql/blob/master/example/githubqldev/main.go#L44L97 which also uses "structs / instances" to define queries. I didn't notice the fact that you could be much more productive by copying queries from GraphiQL into the code. I think a next step could be to use the https://pub.dartlang.org/packages/graphql_parser to transform a GQL query string into the internal library DSL... I am going to add it to the roadmap! |
Hi @metalmatze, I have worked on this improvement this morning and it seems promising. I will be glad to have your opinion on that. Cheers 🍻 |
That looks really awesome and pretty easy to copy from GraphiQL. 👍 |
Hey. I finally have time to check this out. Sadly this option to write the queries as a string was removed again, correct? 🤔 |
That is right. The previous implementation was working but was using mirrors. Since #7, I have remove mirrors usage to support flutter. At the moment, you have to use the I will create a code generator soon that converts GQL queries (as string) to the |
Hey! Thanks for creating that lib. I'm going to look into at once I'm more familiar with the basics of dart again. It's been a long time...
I want to learn about your approach to create the queries like this:
https://github.com/hourliert/graphql_client/blob/716ddcae1b33a7400c99dd89fc96a0a6b0a948a6/example/graphql_client_example.dart#L27-L39
IMO it's way better to use simple string queries, run them and after getting the response marshall them into the objects you'd like to work with.
What makes this so much better to work with, is the fact that you can actually write the queries in GraphiQL and just copy & paste them over into your code. This is just not possible with the current approach and thus probably error prone.
Cheers 🍻
The text was updated successfully, but these errors were encountered: