Untitled
unknown
plain_text
a year ago
748 B
8
Indexable
from sqlalchemy.orm import Session
from typing import List
from app.models.content import Content
from app.graphql.types.content_type import ContentType
from app.graphql.schema import Info
async def get_quick_links(self, info: Info) -> List[ContentType]:
session: Session = info.context.session
# Ensure this matches the field name in the SQLAlchemy model
quick_links = session.query(Content).filter_by(type="Quick Links").all()
return [ContentType(
id=item.id,
type=item.type,
text=item.text,
link=item.link,
order=item.order,
created_date=item.created_date,
updated_date=item.updated_date
) for item in quick_links]Editor is loading...
Leave a Comment