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

Elements fetched directly by gRex aren't instantiated as Models #4

Open
jbmusso opened this issue Apr 5, 2014 · 0 comments
Open

Elements fetched directly by gRex aren't instantiated as Models #4

jbmusso opened this issue Apr 5, 2014 · 0 comments
Assignees

Comments

@jbmusso
Copy link
Owner

jbmusso commented Apr 5, 2014

All gRex.Gremlin scripts which are currently directly executed by gRex cannot be post-processed by Mogwai. This means that fetched graph Elements (typically Vertices) cannot be automatically - even optionally - instantiated as appropriate Mogwai Models, given their respective $type property (which is what Mogwai.client.query() currently does).

Possible solutions :

  1. Add a new functionality to gRex

A typical solution would be to add a gRex.query() function with a single optional function parameter that would be responsible for post-processing all elements in the response.results array returned by Rexster. A default postProcess function could also be set at gRex instantiation in the settings object passed to gRex.connect().

  1. Monkey patch gRex in Mogwai

Mogwai could override gRex.exec() and allow for optional post processing.

@jbmusso jbmusso self-assigned this Apr 5, 2014
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