I wonder if there is a way to use my Neo4j OGM annotated Java classes as a schema for neo4j-graphql-java.
I have my model classes and I don't want to have them duplicated in the IDL (or SDL) format.
Model example:
@lombok.Data
@JsonIdentityInfo(
generator = ObjectIdGenerators.PropertyGenerator.class,
property = "id")
public abstract class EntityMetadata {
@Id
String id;
long lastChangeTime;
String comment;
}
@Setter
@Getter
public class EntityA extends EntityMetadata {
String propA;
@Relationship(direction = Relationship.OUTGOING, type = "TEST")
ArrayList<EntityMetadata> entityBs = new ArrayList<>();
}
@Setter
@Getter
public class EntityB extends EntityMetadata {
String propB;
@Relationship(direction = Relationship.INCOMING, type = "TEST")
EntityA entityA;
}
If currently there is no such feature how would you add it? Overall, do you think it is possible?
I believe at the moment SchemaBuilder supports SDL strings and TypeDefinitionRegistry. I guess the easier approach would be to create TypeDefinitionRegistry in runtime from model classes using reflection and then use it in SchemaBuilder.
I saw a post by @jexp, he has SDL separate from the model class.
I wonder if there is a way to use my Neo4j OGM annotated Java classes as a schema for neo4j-graphql-java. I have my model classes and I don't want to have them duplicated in the IDL (or SDL) format.
Model example:
If currently there is no such feature how would you add it? Overall, do you think it is possible?
I believe at the moment
SchemaBuilder
supports SDL strings andTypeDefinitionRegistry
. I guess the easier approach would be to createTypeDefinitionRegistry
in runtime from model classes using reflection and then use it inSchemaBuilder
.I saw a post by @jexp, he has SDL separate from the model class.