-
Notifications
You must be signed in to change notification settings - Fork 766
Validate Meta.fields and Meta.exclude on DjangoObjectType #842
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
Conversation
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.
Nice, thanks @berekuk !
This broke my application. I have a IMO this change should be reverted as it's an unexpected breaking change with no apparent workaround. I think a better term solution would be to also check if there's a |
Uh, sorry. I'm not interested in this patch anymore, since I decided to go with Ariadne instead for my project, so I don't mind it being reverted or whatever. |
@subwindow apologies for breaking your application. We try hard to make sure that minor releases don't contain breaking changes. However in this case I don't think this is a breaking change since it's exposing a misconfiguration with your setup. Adding a value to |
OK, @jkimbo I understand. It's just not super clear because the word "field" is ambiguous. I had to read the source to figure it out. |
Yep I appreciate it's not super clear. It should be thought of as "model fields" really. It's also somewhere were Graphene-Django differs from Django Rest Framework which is not ideal. |
I also agree this is a bad merge and has broken my library that is dependent on |
@NathHorrigan can you give an example of what you mean by "change still throws errors even when I exclude them in my class meta"? Errors should only be thrown if you're defining a field that doesn't exist on the django model. |
It's a bit harder to provide an example as we dynamically build graphene-django types but I'm getting errors when my graphene types ignore a field on my model (by setting Is this the intended effect? |
Error: |
IMO what would be nice is to rework the error message to specifically say "Django model field" and to change it to a deprecation warning and not an error. |
@subwindow @NathHorrigan I've been thinking about this more and I think you're right this should be a warning rather than an exception for now. Also it shouldn't warn on custom fields either. I'll create a PR to that effect. |
PR: #862 |
@subwindow @NathHorrigan I've just released v2.8.1 that downgrades the errors if a field doesn't exist on a model to warnings. It also takes custom fields into account. Sorry for the inconvenience. |
Thank you! |
@jkimbo v2.8.1 came with other errors 🙂 It gives warning for all the model fields in |
Ah I didn't check the exclude list... Sorry @ulgens, I'll fix this right away. |
Thank you so much @jkimbo I'm not able to test it at the moment but i can ping you back when i can test. |
A more detailed explanation can be found on the release notes of the v2.8.0 and v.2.8.1 - https://github.com/graphql-python/graphene-django/releases/tag/v2.8.0 - https://github.com/graphql-python/graphene-django/releases/tag/v2.8.1 And the PRs where the changes were introduced: - graphql-python/graphene-django#842 - graphql-python/graphene-django#862
A more detailed explanation can be found on the release notes of the v2.8.0 and v.2.8.1 - https://github.com/graphql-python/graphene-django/releases/tag/v2.8.0 - https://github.com/graphql-python/graphene-django/releases/tag/v2.8.1 And the PRs where the changes were introduced: - graphql-python/graphene-django#842 - graphql-python/graphene-django#862
A more detailed explanation can be found on the release notes of the v2.8.0 and v.2.8.1 - https://github.com/graphql-python/graphene-django/releases/tag/v2.8.0 - https://github.com/graphql-python/graphene-django/releases/tag/v2.8.1 And the PRs where the changes were introduced: - graphql-python/graphene-django#842 - graphql-python/graphene-django#862
A more detailed explanation can be found on the release notes of the v2.8.0 and v.2.8.1 - https://github.com/graphql-python/graphene-django/releases/tag/v2.8.0 - https://github.com/graphql-python/graphene-django/releases/tag/v2.8.1 And the PRs where the changes were introduced: - graphql-python/graphene-django#842 - graphql-python/graphene-django#862
A more detailed explanation can be found on the release notes of the v2.8.0 and v.2.8.1 - https://github.com/graphql-python/graphene-django/releases/tag/v2.8.0 - https://github.com/graphql-python/graphene-django/releases/tag/v2.8.1 And the PRs where the changes were introduced: - graphql-python/graphene-django#842 - graphql-python/graphene-django#862
A more detailed explanation can be found on the release notes of the v2.8.0 and v.2.8.1 - https://github.com/graphql-python/graphene-django/releases/tag/v2.8.0 - https://github.com/graphql-python/graphene-django/releases/tag/v2.8.1 And the PRs where the changes were introduced: - graphql-python/graphene-django#842 - graphql-python/graphene-django#862
A more detailed explanation can be found on the release notes of the v2.8.0 and v.2.8.1 - https://github.com/graphql-python/graphene-django/releases/tag/v2.8.0 - https://github.com/graphql-python/graphene-django/releases/tag/v2.8.1 And the PRs where the changes were introduced: - graphql-python/graphene-django#842 - graphql-python/graphene-django#862
A more detailed explanation can be found on the release notes of the v2.8.0 and v.2.8.1 - https://github.com/graphql-python/graphene-django/releases/tag/v2.8.0 - https://github.com/graphql-python/graphene-django/releases/tag/v2.8.1 And the PRs where the changes were introduced: - graphql-python/graphene-django#842 - graphql-python/graphene-django#862
Resolves #840.