-
Notifications
You must be signed in to change notification settings - Fork 112
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 support for mapping all nullable types as pointers #198
Conversation
|
This seems like a great start, thank you! Fingers crossed that the tests don't find any place it needs to be more complicated.
If that's simpler, and seems to work for you, I think it's fine! Only thing is to rename the option to match. Maybe just
Hmm, slightly awkward actually. In general this sort of thing goes in Then the other thing is whether we need an integration test. If we do, it will be a bit annoying, since this is a global config option and those all share one config. But if we are able to stick to doing exactly the same thing as the |
Thanks for the fast feedback! I'll reconsider the naming and investigate and adding a test, though it will likely be a couple of days before I get to it. |
For now there is only one setting, so the indirection isn't helpful.
I've added a couple of tests, one that has a few nullable outputs (including lists) and one with some nullable inputs. The result is what I expect. |
Neat, thanks for putting this together! Only thing I notice is that a value of type |
Awesome! I did think about |
This is a bare minimum implementation of the approach suggested in #178 (comment), which I figured I'd open sooner than later for early feedback!
Per the new detail in the sample
docs/genqlient.yaml
:The documentation is slightly misleading atm as there's actually no validation of the values, and only
pointer
will have any effect (anything else has the default behaviour). It also affects arguments, no just fields, which is desirable imo. There are also no tests, as I'm not quite sure where best to put them 😅 Any pointers (pun intended?) would be great.I've tested this out with a small local setup, which isn't fully integrated yet, so I'm not at all confident that it fully works. It does generate what I'd expect for a simple schema, e.g. given:
And:
It will generate:
I have: