Closed shaozi closed 2 years ago
Use SQLAlchemyConnectionField
and have your resolver return None
.
class EmployeeQuery(graphene.ObjectType):
all_employees = SQLAlchemyConnectionField(
Employee.connection, sort=Employee.sort_argument()
)
def resolve_all_employees(parent, info, **args):
print(f"resolve_all_employee: =========== user = {info.context.user}")
return None
return None
, return
and omitting the return statement are equivalent.
awesome! Thank you, it worked like a charm! Where is this documented?
I believe this is currently undocumented. Closing this, as documentation is another issue, the original problem seems to be solved. If you have further questions, feel free to open another issue!
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics referencing this issue.
It is convenient to just add two lines of code to do get by id and get all queries:
My question is, how do I enhance/customize the query so I can access the
info
for authorization purpose?Currently I have to implement my own resolver, but for
all_employees
I lost the relay edges:Is there a better more "graphene SQLAlchemy" way?