Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query request Enhancement #7

Open
VillerotJustin opened this issue Jan 26, 2024 · 0 comments
Open

Query request Enhancement #7

VillerotJustin opened this issue Jan 26, 2024 · 0 comments

Comments

@VillerotJustin
Copy link

VillerotJustin commented Jan 26, 2024

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"})
@VillerotJustin VillerotJustin changed the title Query request Enhencement Query request Enhancement Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant