-
Notifications
You must be signed in to change notification settings - Fork 731
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
fix: InputDict dynamicMember
operator conflict with hash
function
#2607
Conversation
✅ Deploy Preview for apollo-ios-docs canceled.
|
I assume this will be the same issue for I'd rather special case the keyword |
fd9eff7
to
6f5fcea
Compare
6f5fcea
to
1362c67
Compare
1362c67
to
b6bb519
Compare
I checked and no this issue doesn't exist for That gave me the idea of simply making I've added a field named |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely the right way to handle this. Nice!
Nit: I'm not a fan of adding properties to test edge cases to our example generated models. I add things to them while I'm testing things out, but then I write a unit test and remove the test properties from the main generated models. This really isn't a big deal, and if you want to keep it, I'm not going to argue it. But I would hesitate to make this a common practice. These are meant to be an example of the basic structure, so that our users can see an example of what good generated models look like. But if we start using them to maintain regression testing of edge cases, they will become ugly and not a good quality example for people. And they also conflict with the point of unit tests. I don't want us getting into a habit of relying on "if the example models still build, then it's okay." because that logic leads to lazier unit testing habits.
I had this test which I removed - d766a29. |
99f9e02
to
ed7be04
Compare
Fixes #2603
If you have an
InputObject
with a parameter name ofhash
it will conflict with the Hashable protocol function namedhash
. We can fix this byusing the fully qualified operator name for theremoving dynamic member lookup and using a custom subscript.dynamicMember
subscript