-
Notifications
You must be signed in to change notification settings - Fork 227
Implement Mechanism to Selectively Override Automatic Field Creations #214
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
@@ -1,50 +0,0 @@ | |||
from py.test import raises |
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.
FYI I moved those tests to test_types.py because it was not clear where to add new tests.
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.
Thanks for the feedback @wyattanderson!
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.
LGTM
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.
Soooooo nice !
Add documentation would be very nice, to see a "how to" automatically integrated to the website published documentation.
Do you plan to do it in another PR ? Otherwise, could you add it in this one ?
query = """ | ||
query ReporterQuery { | ||
query { |
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.
Is there a reason to "de-name" the query here ?
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.
There was no reason to name the query so I removed to make tests more consistent and simple.
@@ -200,42 +330,34 @@ class _TestSQLAlchemyConnectionField(SQLAlchemyConnectionField): | |||
|
|||
|
|||
def test_default_connection_field_factory(): | |||
_registry = Registry() |
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.
Why ? ;)
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.
I realized that was not needed because the global registry is reset between tests (see confest.py
).
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.
@Nabellaleen Thanks for the review!
For now, I've added detailed docstrings witth examples to ORMField
. I'm planning to add proper documentation in an upcoming PR once I'm done relationships
and hybrid
overriding (see my first comment on this thread).
Cheers
query = """ | ||
query ReporterQuery { | ||
query { |
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.
There was no reason to name the query so I removed to make tests more consistent and simple.
@@ -200,42 +330,34 @@ class _TestSQLAlchemyConnectionField(SQLAlchemyConnectionField): | |||
|
|||
|
|||
def test_default_connection_field_factory(): | |||
_registry = Registry() |
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.
I realized that was not needed because the global registry is reset between tests (see confest.py
).
This implements the overriding mechanism discussed in #209.
Changes include:
ORMField
classtype
,description
,deprecation_reason
andrequired
prop_name
. This was preferred overname
to avoid confusion / collision withgraphene.Field
parameters.TODOs that I'm planning to address as soon as this PR is merged: