-
Notifications
You must be signed in to change notification settings - Fork 121
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
Feedback #1
Comments
Until gql-dart/gql#32 is merged, to run the example you will need to override the |
@smkhalsa This looks like some quality work! I particularly like the use of
Other than that, I doubt I'll have the time to play around with it more thoroughly for a while. Cool stuff though! |
Thanks @micimize for the input!
Yes, I'm definitely interested in exploring built_value, especially for the generated data classes (gql-dart/gql#35).
I know, I thought the same. For some reason, |
@smkhalsa, great work! I am a fan of small focused packages, so I'd say the cache/store layer should be extracted. By following the issues on We should think about making the codegen part more user-friendly. Your suggestions at gql-dart/gql#36 might be one way to fix it. Or maybe we should take another direction - bundle the code from Also, if you have any feedback or concrete examples of how using Again, great work! Sorry I cannot do a more detailed exploration of the client at this point. |
@klavs Thanks for the feedback and encouragement!
I agree. I started working on it as a monorepo, but once the API stabilizes I intend on splitting the packages up into the following independent packages:
Absolutely. Right now I'm writing my
The more I think about it, the more I feel that using Additionally, the built_value Although these examples are specific to my client implementation, I feel that the underlying benefits are more broadly applicable. |
The real problem with There are a few pieces of the
I actually like the concept of |
@smkhalsa Looks like Awesome work khalsa ji😀, will take it out for a spin!!! |
@JasCodes great, let me know if you have any feedback |
https://github.com/smkhalsa/gql_client/blob/a95803add3c52e90b7fa578e32773292dfc3d262/lib/src/client/client.dart#L17-L20 https://github.com/smkhalsa/gql_client/blob/a95803add3c52e90b7fa578e32773292dfc3d262/lib/src/client/query_response.dart#L16-L17 Is there any particular reason, why Kudos to you for readable code! |
Good point. I've removed the prefixes.
Interesting. @klavs, can you please expand on this a bit? Honestly, I've been thinking about going the other direction and adding type-awareness into the cache layer (or at least Ideally, we'd also add a builder to generate
I thought about it (and am still open to it). However, since |
@smkhalsa I think type aware cache would be such an improvement. In fact with I must you must be thinking implementing unified client side queries as well. Having single cache for device data and server data would be awesome!!! |
@smkhalsa, never mind! I think I just misinterpreted the code. The underlying cache seems to be implemented as a low-level "untyped" storage while you've added the type-layer at the appropriate places. |
I LOVE your work and appreciate it so much!
Cheers bro! |
Sorry for second comment, 2 more points:
|
Hey @iscriptology!
I think the Dart build system is designed not to override contents of non-generated files. So the best solution to query inlining would still keep the string and ast representation of the query in memory. Please let me know if there is a way to do what you've suggested. |
@klavs hey For example some pseudo code that comes to my mind:
Sorry for the style of the code I’m on my iPhone on the road ❤️ |
That's interesting... If Dart strips annotations from the build, it might be the way to go. |
I think the best first step is to write an example code with some edge cases showing how you'd want it to behave. |
@iscriptology thanks for the feedback!
I agree that (at least for Flutter) defining queries in the same file as the Widget using an annotation is probably cleaner. Can you think of any downsides to this approach? One benefit of separate .graphql files is that there's already an ecosystem around .graphql files that you can plug into which provides useful functionality in IDEs such as syntax highlighting / validation / formatting.
I assume you're referring to Apollo's Automatic persisted queries? I haven't used this feature, but it seems like this is tightly coupled with Apollo's server implementation. What changes to the client would be needed to implement this?
I believe this relates to #3, so please see my comments there.
I thought about this, but I didn't want to be opinionated about dependency injection. I recently switched from using
I've been thinking about renaming the package. I agree that flutter is likely the most common use case for this library, but I don't think we need to tie the package name to flutter (which may discourage other use cases). |
Inline queriesI don't see any downsides since we are still backward compatible to separate .graphql files. Persisted queriesYes it is an apollo-specific feature but I know that other server implementations adopted it since it is also supported in the relay client (that is not part of the apollo organization) Dependency injectionIt is a common practice to include in a flutter library a provider widget and consumer widgets ( Flutter vs pure dartI think if this package includes flutter widgets and has the flutter SDK in its pubspec, it is a flutter library and there's no actual use case other than flutter right now. So I would go ahead and change the name. ( |
Closing this issue. Feel free to open new issues with specific feedback. |
@klavs, @micimize, @comigor, I just published this package and thought you guys might be interested in checking it out.
I'd love any thoughts / feedback you may have.
Check out the readme and example.
The text was updated successfully, but these errors were encountered: