Hey team, I got several other questions when tryin...
# troubleshoot
r
Hey team, I got several other questions when trying to implement corresponding GraphQL logic in
datahub-graphql-core
module according to the "DataHub GraphQL Core" readme page: 1. Looks like the ReadMe needs some update? I could not easily find what the doc told me to do, like
resources/gms.graphql
,
DataLoaders
,
Mappers
and
DataFetchers
2. Looks like the
SearchableEntityType
is deprecated. Should the new LoadableType extend SearchableEntityType? If no, what’s the alternative? 3. I am a little confused about
RestliEntityClient
and
JavaEntityClient
Looks like, they both finally call
EntityService -> EbeanAspectDao -> DB
The difference is
RestliEntityClient
send a Restli request and the Restli server calles
EntityService
But
JavaEntityClient
call
EntityService
directly? If I would like to introduce a new entity, looks like I do not need to change them? 4. Looks like Mappers and DataFetchers are not needed now since batchLoad() return GraphQL object?
b
1. Yes, the readme needs an update. Some details have changed in the past couple months. We will prioritize the work on our side 2. We've moved to using
SearchAcrossEntitiesResolver
for handling cross-entity search in one place. You'll need to update this to add your entity to search! SearchableEntityType was previously used when we had search for each entity type separately. 3. Both of these clients do what you mentioned - eventually call the DB. One does so indirectly, over the wire. The other is "in process". This is really just to make sharing the API across different components of DataHub easier (mcl consumer, gms, etc). You should not need to change this to add a new entity. Simply use the
batchGetV2
API to fetch aspects for your new entity, as detailed inside of
DatasetType.java
4. Mappers are optional. Inside of your NewEntityType.java, you'll need to map the GMS objects to the auto-generated GraphQL equivalent. We tend to define mappers to do this part! You're correct that you should not need to add a DataFetcher if you've defined a Type. You simply need to register the Type class in
GmsGraphQLEngine.java
thankyou1 1
r
Great! Thanks for explaining!
Hey @big-carpet-38439 Do I need to do anything about AutoCompleteResover?
@big-carpet-38439 could you help with this?
g
Ah, think it was fixed with this PR: https://github.com/datahub-project/datahub/pull/4400
b
Sorry for the delay folks- yes this should be addressed as mentioned