aws / chalice

Python Serverless Microframework for AWS
Apache License 2.0
10.67k stars 1.01k forks source link

Can't get querystring parameters on connect #2055

Open moisesmarques opened 1 year ago

moisesmarques commented 1 year ago

Hey guys,

Would be incredible to have querystring parameters in the event.

class WebsocketEvent(BaseLambdaEvent):
    def __init__(self, event_dict: Dict[str, Any], context: Any):
        super(WebsocketEvent, self).__init__(event_dict, context)
        self._json_body: Optional[Dict[str, Any]] = None

    def _extract_attributes(self, event_dict: Dict[str, Any]) -> None:
        request_context = event_dict['requestContext']
        self.domain_name: str = request_context['domainName']
        self.stage: str = request_context['stage']
        self.connection_id: str = request_context['connectionId']
        self.body: str = str(event_dict.get('body'))
        self.query_params: str = str(event_dict.get('queryStringParameters')) # <------------- I'm using like that.

...