-
Notifications
You must be signed in to change notification settings - Fork 228
Closed
Description
schema.py
class Query(graphene.ObjectType):
#node = relay.Node.Field()
# Allow only single column sorting
employee = relay.Node.Field(Employee)
all_employees = SQLAlchemyConnectionField(
Employee)
# Allows sorting over multiple columns, by default over the primary key
all_roles = SQLAlchemyConnectionField(Role)
# Disable sorting over this field
all_departments = SQLAlchemyConnectionField(Department, sort=None)
query from GraphiQL
{
allEmployees(sort: [name_asc] ) {
pageInfo {
startCursor
endCursor
hasNextPage
hasPreviousPage
}
edges {
cursor
node {
id
name
department {
name
}
}
}
}
}
The result from query would be:
{
"errors": [
{
"message": "Unknown argument \"sort\" on field \"allEmployees\" of type \"Query\".",
"locations": [
{
"line": 2,
"column": 16
}
]
}
]
}
Metadata
Metadata
Assignees
Labels
No labels