Hi... Does anyone tried to extend the datahub enti...
# ingestion
v
Hi... Does anyone tried to extend the datahub entities ? We are able to easily extend the gms by simply putting pdl files. But for graphql-core, we are kinda of confused on where to start adding custom code. Some inputs will really help. thanks
plus1 1
m
Hi @victorious-dream-46349, Here is a quick doc about graphql core along with some steps to extend an entity - https://datahubproject.io/docs/datahub-graphql-core/ Adding an Aspect to an Entity (GraphQL) 1. Edit 
entity.graphql
 file inside 
datahub-graphql-core
 to include the new GraphQL Schema Types for your new Aspect (manually). Each Metadata Entity has its own top-level GraphQL Type (e.g. Dataset, Chart, Dashboard..). Aspects are optional fields associated with these entities. 2. Run 
./gradlew datahub-graphql-core:build
 to generate strongly typed Java objects corresponding to schemas in Step 1. 3. Edit 
<Entity>SnapshotMapper.java
 to provide a mapping from the Metadata Service Models to the GraphQL Model defined in Step 1. For example, see DatasetSnapshotMapper.java. 4. Build and deploy 
metadata-service
  again: 
./gradlew metadata-service:war:build
 and then 
dev.sh
v
Thanks @miniature-tiger-96062 for your inputs. It really really helped us to move forward
Now we are able to see our new entity in home page. When we click on it, it is making browse call to the gms server which is resulting in empty array response. We are seeing any error logs also. We created new EntityType with
browse
method and registered it
GmsGraphQLEngine
in line: https://github.com/linkedin/datahub/blob/master/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/GmsGraphQLEngine.java#L242 . When we click on browser, it is making this browse call, but the value is empty array. Do we need to configure extra for browse feature ? Also, what is the role of these files https://github.com/linkedin/datahub/tree/master/metadata-service/restli-api/src/main/idl ? We have not modified it.