Skip to content

Query request Enhancement #7

@VillerotJustin

Description

@VillerotJustin

I suggest a rework of the query route. Currently, the cypher string is passed through a URL path variable but do to URL encoding some character are lost in the process like the '+' character. So modifying the request to make the variables pass through the body of the request like bellow would solve those problems.

# Query endpoint
@router.get('/q', response_model=Query, summary='Query the database with a custom Cypher string')
async def cypher_query(attributes: dict):
    print(attributes["cypher_string"])
        if attributes["cypher_string"] is not None and attributes["cypher_string"] != "":
        with neo4j_driver.session() as session:
            response = session.run(query=attributes["cypher_string"])
            return Query(response=response.data())
    else:
        raise HTTPException(
            status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
            detail="Empty or null cypher string.",
            headers={"WWW-Authenticate": "Bearer"})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions