aws / graph-explorer

React-based web application that enables users to visualize both property graph and RDF data and explore connections between data without having to write graph queries.
https://github.com/aws/graph-explorer
Apache License 2.0
317 stars 47 forks source link

Changes to Sync the request body with UI #417

Closed mayurvaid-redvest closed 3 months ago

mayurvaid-redvest commented 4 months ago

UI is sending the request with gremlin as root rather than query

Description

Validation

Related Issues

Check List

kmcginnes commented 4 months ago

@mayurvaid-redvest Thanks for the submission.

Can you help me understand a bit about the motivation for this change?

mayurvaid-redvest commented 4 months ago

@kmcginnes . This came up when we were testing this and it is throwing bad request for sparql queries when using proxy

mayurvaid-redvest commented 3 months ago

@kmcginnes , Any comments please let me know ?

kmcginnes commented 3 months ago

@mayurvaid-redvest Sorry for the delay. I have not forgotten about this. I have a few other things to work on before diving in to this.

My plan was to load this up and test it before commenting, but since I haven't found the time I'll just post my preliminary thoughts instead to see what you think.

After taking just a cursory look at the changes, I don't understand why you were seeing an issue in the first place. The Gremlin Explorer instance in the client explicitly sets the body to { query: "...query string..." }.

https://github.com/aws/graph-explorer/blob/5323b930d36fb1d304f57de3806ccc8706dd9caa/packages/graph-explorer/src/connector/gremlin/gremlinExplorer.ts#L13-L31

So your change to the proxy doesn't make sense because you changed it to look for { gremlin: "...query string..." } instead. That shouldn't work.

You also mentioned you have issues running SPARQL queries, but you changed the Gremlin endpoint in the proxy. I don't understand how those are supposed to relate to each other.

Can you help me understand?

mayurvaid-redvest commented 3 months ago

@kmcginnes , This is my bad sorry was looking at the wrong branch/code , Probably was fixed later on

kmcginnes commented 3 months ago

@mayurvaid-redvest no problem. Thanks for the submission either way.