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

g.V<MyType>() not working #1858

Open
AndrewOttavianoAbb opened this issue Jan 15, 2025 · 0 comments
Open

g.V<MyType>() not working #1858

AndrewOttavianoAbb opened this issue Jan 15, 2025 · 0 comments

Comments

@AndrewOttavianoAbb
Copy link

Hello! I have a Gremlin Graph database CosmosDb that I am using to store information about microservices and their dependency/dependant relationships.

My graph nodes have the following fields:

  • id (added by cosmosdb automatically)
  • label (added by cosmosdb automatically)
  • Name
  • RequestVerb
  • EndpointUri
  • EndpointVersion
  • NodeType (<-- this is the partition key)

I have a preexisting project that I wanted to add Gremlinq to, so I did not use any of the VS templates in the docs but I did configure my project based on reading the template source and was able to get my project talking to the database. In the sample project below (redacted sensitive information in the config), you'll see I have a data layer project, business layer project, and a view layer project in the solution and am using DI; this generally reflects the structure of my original project.

In the TestData class, there is a method GetTheData and here in lies the problem. When I use MicroserviceEndpoint in the <>, I receive an empty array as the result (though the query does show that there are steps in the query suggesting it did successfully at least contact the db). When I change to g.V<object>(), I am able to retrieve the singular vertex currently in the database. I attempted to setup my entities like in the example by putting the partition key and id in VertexBase and passing that to UseCosmosDb<VertexBase, EdgeBase> and then inheriting those in MicroserviceEndpoint but no dice. I even attempted to use g.V<VertexBase>() and that doesn't seem to map properly either.

So my question is why isn't V working for me in this case as expected? I referenced #44 but that is a different scenario because they are not configuring Gremlinq with UseCosmosDb (as far as I understand) so the situation is not quite the same.

Also, as a side note, I would like to point out that the docs for using Gremlinq seem really good but the docs for configuring Gremlinq are basically nonexistent (at least what from I could find); you have to use the template or are out of luck 😞

Anyway, any help is appreciated! Thanks!

MyTestSolution.zip

@AndrewOttavianoAbb AndrewOttavianoAbb changed the title g.V<MicroserviceEndpoint>() not working g.V<MyType>() not working Jan 15, 2025
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