-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Non-exhaustive fragment selection #115
Comments
Hey @Jayshua, thanks for opening the issue! The only downside I see is that it could confuse users to have more than one way to do the same thing. For example, someone might find the I wish that there was a more concise way to do a record update! Wouldn't it be nice if there was a way to pass in a record update as an argument! (Analogous to getters with Api.Interface.Account.fragments { ?| onAccountCompany = SelectionSet.map Just Api.Object.AccountCompany.name } Actually, this would also make it easier to do optional arguments! Query.search (\optionals -> { optionals | first = Present 10 }) -- ... Becomes: Query.search { ?| first = Present 10 } -- ... And of course allowing Anyway, those are my initial thoughts on that! What do you think? And thanks again for starting the discussion and sharing those code snippets, I appreciate it 😄 |
It's a trade-off all right. The worse kind too, where it isn't totally clear which option is better. Here are a few more arguments in favor:
I tried to come up with some arguments against, but I honestly couldn't think of anything that you didn't cover. 😅 Regarding the update expression, I'm personally in favor of the Definitely agree on the expressions in the record update syntax. I was really hoping that one would make it to 0.19. 😢 |
Hello @Jayshua, thanks for the conversation, this is a very helpful discussion 👍 I've got some other plates in the air right now. I'll spend some time chewing on this in the meantime and play around with it a bit when I have some cycles. I think it's very much worth considering, I'll get a better sense of the tradeoffs when I get a chance to generate an API for it by hand and get a feel from using that. Thank you so much for sharing your thoughts on this! |
Selecting from interfaces is much easier than it used to be. Thanks for that! Curious if you might be interested in having an api like this as well?
I went to write a selection for this interface and this is the first thing that came to mind. Which suggests this might be a good way for it to work.
I was thinking this would be in addition to the exhaustive fragment selections rather than instead of - automatic unwrapping of a maybe is pretty useful when selecting exhaustively.
Here's what it looks like right now for reference:
The text was updated successfully, but these errors were encountered: