async def METHOD_NAME(session, notebook_id) -> Notebook | None:
    response = await session.execute(
        gql(
            """
            query GetBeneficiaryQuery($notebook_id:uuid!) {
                notebook_by_pk(id: $notebook_id) {
                    beneficiary {
                        id nir dateOfBirth
                        externalDataInfos(where: {
                            externalData: { source: { _eq: peio } } }
                            order_by: { created_at: desc }
                            limit: 1
                        ) {
                            externalData { hash }
                        }
                        deployment {
                            config
                        }
                    }
                    diagnosticFetchedAt
                    situations { id situationId createdAt deletedAt }
                    focuses {
                        id
                        theme
                        created_at: createdAt
                        targets(where: {status: {_eq: "in_progress"}}) {
                            id target
                        }
                    }
                }
            }
            """
        ),
        {"notebook_id": notebook_id},
    )
    notebook = response["notebook_by_pk"]
    if not notebook:
        return None
    infos = notebook["beneficiary"]["externalDataInfos"]
    external_data_hash = None
    if isinstance(infos, list) and len(infos) == 1:
        info = infos[0]
        external_data_hash = info["externalData"]["hash"]
    return Notebook(
        diagnostic_fetched_at=notebook["diagnosticFetchedAt"],
        beneficiary_id=notebook["beneficiary"]["id"],
        nir=notebook["beneficiary"]["nir"],
        date_of_birth=notebook["beneficiary"]["dateOfBirth"],
        last_diagnostic_hash=external_data_hash,
        situations=[
            NotebookSituation.parse_obj(situation)
            for situation in notebook["situations"]
        ],
        deployment_config=notebook["beneficiary"]["deployment"]["config"] or {},
        focuses=[Focus.parse_obj(focus) for focus in notebook["focuses"]],
    )