Examples: fix models, extend Flask example #287
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR only applies to the example code.
Small fix: the example models used the wrong name for a backref, resulting in
role.roles
rather thanrole.employees
.Small fix: in https://github.com/graphql-python/graphene-sqlalchemy/pull/210/files#diff-b14ba1019bb9939dd94d33195e63ae48L35-L40 the example for a single sort column was replaced by
sort=Employee.sort_argument()
, which is not the same. (It allows for sorting on multiple columns simultaneously, just like when not specifyingsort=
at all.) While fixing and documenting that: asall_employees
has more columns thanall_roles
, it makes sense to allow multiple sort columns for the first, and only one for the latter.Added an example
totalCount
attribute for the connections in the Flask example, as per How to have edges/totalCount on a relationship field? #58.