async def _generate_team_entities(
        self, client: httpx.AsyncClient
    ) -> AsyncGenerator[LinearTeamEntity, None]:
        """Generate entities for all teams in the workspace.

        Args:
            client: HTTP client to use for requests

        Yields:
            Team entities
        """
        # Define the GraphQL query template with {pagination} placeholder
        query_template = """
        {{
          teams({pagination}) {{
            nodes {{
              id
              name
              key
              description
              color
              icon
              private
              timezone
              createdAt
              updatedAt
              parent {{
                id
                name
              }}
              issueCount
            }}
            pageInfo {{
              hasNextPage
              endCursor
            }}
          }}
        }}
        """

        # Define a processor function for team nodes
        async def process_team(team):
            team_id = team.get("id")
            team_name = team.get("name")
            team_key = team.get("key")
            parent = team.get("parent")
            team_parent_id = parent.get("id", "") if parent else ""
            team_parent_name = parent.get("name", "") if parent else ""

            logger.info(f"Processing team: {team_name} ({team_key})")

            # Create team URL
            team_url = f"https://linear.app/team/{team.get('key')}"

            # Build breadcrumbs list
            breadcrumbs = [Breadcrumb(entity_id=team_id, name=team_name, type="team")]

            # Create and yield LinearTeamEntity
            yield LinearTeamEntity(
                entity_id=team_id,
                name=team_name,
                breadcrumbs=breadcrumbs,
                url=team_url,
                # LinearTeamEntity specific fields
                key=team_key,
                description=team.get("description", ""),
                color=team.get("color", ""),
                icon=team.get("icon", ""),
                private=team.get("private", False),
                timezone=team.get("timezone", ""),
                created_at=team.get("createdAt", ""),
                updated_at=team.get("updatedAt", ""),
                parent_id=team_parent_id,
                parent_name=team_parent_name,
                issue_count=team.get("issueCount", 0),
            )

        try:
            # Use the paginated query helper with our team processor
            async for entity in self._paginated_query(
                client, query_template, process_team, entity_type="teams"
            ):
                yield entity
        except Exception as e:
            logger.error(f"Error in team entity generation: {str(e)}")
Generate entities for all teams in the workspace.

        Args:
            client: HTTP client to use for requests

        Yields:
            Team entities
        
backend/airweave/platform/sources/linear.py