Skip to content

features: ConnectionField customization, LazyReferences, better field descriptions #69

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

Merged
merged 6 commits into from
Feb 12, 2019

Conversation

zrlay
Copy link
Contributor

@zrlay zrlay commented Feb 6, 2019

This PR is for a handful of features we've been enjoying in production.

Some are minimal changes like better field descriptions based on common mongoengine field attributes like help_text or docstrings, others are potentially breaking such as refactoring MongoengineConnectionField to lean less on class methods in favor of more intuitive instance methods.

Would very much like feedback and discussion!

zrlay added 4 commits January 31, 2019 18:15
…filters on Connection fields.

• Subclassing or replacing automatically attached/converted MongoengineConnectionField is possible by specifying `connection_field_class` in the ObjectType meta.
• A new API for specifying a callable that can return custom filters or a queryset when generating a connection iterable: `get_queryset`.
• Refactors MongoengineConnectionField to use existing graphene connection functions instead of reinventing list slicing.
• Refactors MongoengineConnectionField to do object lookup as an instance method instead of doing wacky things with the connection class methods. Should make subclassing get_queryset and default_resolver much more useful and intuitive.
@zrlay
Copy link
Contributor Author

zrlay commented Feb 6, 2019

Also happy to split the PR into related subcomponents and submit individually, if preferred.

@coveralls
Copy link

coveralls commented Feb 6, 2019

Pull Request Test Coverage Report for Build 216

  • 124 of 125 (99.2%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.6%) to 95.908%

Changes Missing Coverage Covered Lines Changed/Added Lines %
graphene_mongo/types.py 5 6 83.33%
Totals Coverage Status
Change from base Build 211: -0.6%
Covered Lines: 375
Relevant Lines: 391

💛 - Coveralls

@abawchen
Copy link
Collaborator

@zrlay

Thanks for the PR 👍
I just turn off vocation mode from lunar New Year.
I will spend some time to digest this one and get you back as soon as possible.

@abawchen
Copy link
Collaborator

@zrlay Looks good to me, merged.

@abawchen abawchen merged commit c98b33a into graphql-python:master Feb 12, 2019
zrlay added a commit to zrlay/graphene-mongo that referenced this pull request Feb 13, 2019
arunsureshkumar pushed a commit to arunsureshkumar/graphene-mongo that referenced this pull request Nov 2, 2020
features: ConnectionField customization, LazyReferences, better field descriptions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants