-
Notifications
You must be signed in to change notification settings - Fork 0
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
Account for nested models and Dates/Times #1
Account for nested models and Dates/Times #1
Conversation
@spockNinja thank you for this, looks good. Can you add some tests for the types and the nested model? |
Absolutely. 👍 |
I got to the point where I was using the graphql endpoint in our client-side, and realized that the response from the mutation is less flexible than what we had before. Much like the root flexibility of graphql, we have it so that a mutation should be able to choose what data it wants back, at least data related to the mutated object. In our case, it looks like this:
And the Before the serialization mapping, it looked like this:
To achieve similar functionality as easily with the serializer mapping, it has to be to a With that, it now looks like:
The question is, do you think others would want this? If so, I'll clean it up and probably pull some commonalities between it and the |
@spockNinja sorry for the late reply I was at europython :) So, I'm not really sure that's a common use case, when I create a Policy I'd expect to get its fields right away, instead of having them namespaced into Maybe after my PR is merged we can create a discussion on the main repo and see what other people think :) |
fc521b1
to
ee23638
Compare
No problemo. I'm sure that was a good time. :) I pulled that last bit out for now, and added tests for the nested serializers and date/time converters. |
Great stuff, sorry it took me a while to get back to you! |
@patrick91
Thanks for all the work in getting Serializers working with graphene-django. I whipped up a few additions after testing out your PR on a project. The biggest things I noticed when testing were the ability to nest models in serializers and the correct mapping for Date/Time fields.
Let me know if there's anything I can do to help get this feature merged upstream.