Skip to content
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

Add batching params #260

Merged
merged 4 commits into from
Feb 12, 2020
Merged

Add batching params #260

merged 4 commits into from
Feb 12, 2020

Conversation

jnak
Copy link
Collaborator

@jnak jnak commented Jan 24, 2020

Add parameters to toggle batching on or off. This can be configured at 2 levels:

  • we can configure all the fields of a type at once via SQLAlchemyObjectType.meta.batching
  • or we can specify it for a specific field via ORMfield.batching. This trumps SQLAlchemyObjectType.meta.batching.

@coveralls
Copy link

coveralls commented Jan 24, 2020

Coverage Status

Coverage increased (+0.05%) to 97.578% when pulling 7003e60 on jnak:batch-sql-4 into 7a48d3d on graphql-python:master.

Copy link
Collaborator

@Nabellaleen Nabellaleen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've copy the comments I've done on your fork PR, to be able to follow easily the answers here ;)

graphene_sqlalchemy/converter.py Outdated Show resolved Hide resolved
graphene_sqlalchemy/converter.py Outdated Show resolved Hide resolved
graphene_sqlalchemy/converter.py Outdated Show resolved Hide resolved
resolver = get_custom_resolver(obj_type, orm_field_name)
if resolver is None:
resolver = get_batch_resolver(relationship_prop) if batching_ else \
get_attr_resolver(obj_type, relationship_prop.key)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
get_attr_resolver(obj_type, relationship_prop.key)
elif resolver is None:
resolver = get_attr_resolver(obj_type, relationship_prop.key)

graphene_sqlalchemy/converter.py Outdated Show resolved Hide resolved
katy-sadowski
katy-sadowski previously approved these changes Jan 27, 2020
Copy link

@katy-sadowski katy-sadowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a test to check approve rights.

@jnak
Copy link
Collaborator Author

jnak commented Jan 27, 2020

@Nabellaleen Ignore @katy-sadowski approval - I asked her to do this so I can tests different permission settings.

fix tests
Nabellaleen
Nabellaleen previously approved these changes Jan 29, 2020
@jnak jnak merged commit 17d535e into graphql-python:master Feb 12, 2020
@himat
Copy link

himat commented Aug 28, 2020

Was the default batching true or false?

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.

5 participants