Closed shivam-880 closed 3 years ago
Hi @iamsmkr thanks very much taking the time create this example.
On the face of it, adding another export format would not be difficult, and other export formats have already been requested - see #8.
One thing I would like to clarify, does the arrows proprt-graph model contain all the information needed to specify a GraphQL schema? I notice a few differences comparing the model and the schema in your example. Specifically:
personId
property in the model. Is this an oversight, or something that should be inferred?!!
mean @unique
in your notation? That seems to be the case from glancing at it.Many thanks!
@apcj personId
is mentioned in the property graph model. I added !!
for my personal interpretation. Sorry it leaked in the example here. To me: first !
means unique and second !
means mandatory. Probably, these interpretations could be ignored,
@iamsmkr Thank you for a great suggestion. We have implemented the first pass of this, please try it out, we would love to hear your thoughts.
@danstarns How/Where do I try it? I don't see any option to export the property graph model as type definitions.
@danstarns How/Where do I try it? I don't see any option to export the property graph model as type definitions.
Try hard-refreshing.
Couple of suggestions:
Couple of suggestions:
- I think it would be better to use camel cases for any property name. For example, "actor_in" could be named instead as "actorIn".
- Relationships in property graph models are mostly "many-to-many" in nature. Hence they must of lists. For example, "actor_in: Movie" should be "actorIn: [Movie]"
- I have created another enhancement request for syntax highlighting. Add syntax highlighting in export code for "json", "cypher" and "graphql" #35
For point 2. You can wrap the relationship type in braces like the image attached:
@danstarns Relationship properties aren't currently supported by Neo4j GraphQL library (please follow the link below) but you may have to consider it too when supported. https://stackoverflow.com/questions/67985760/how-to-create-a-relationship-property-in-graphql-type-definitions-using-neo4j-gr
@iamsmkr thanks again for this suggestion. And thanks to @danstarns for implementing this! I'm going to close this issue now, but please feel free to open other issue for specific enhancements - as you have already done!
Seems like there is a one-to-one mapping between "Data Models" built in Arrows.app and Neo4j Graphql "Type Definitions" and it should be possible to export data models as type definitions.
Example Data Model
Example Neo4j GraphQL Type Definitions
Example Data