Sample GraphQL query to retrieve all datasets under the Kafka data platform

Original Slack Thread

<@U06TM7M40RK> give me sample graphql query to get all datasets under kafka dataplatform

To retrieve all datasets under the Kafka data platform using GraphQL, you can use the search query with a filter for the Kafka platform. Here’s a sample query:

query getKafkaDatasets {
  search(input: {
    type: DATASET,
    query: "*",
    start: 0,
    count: 1000,
    orFilters: [
      {
        and: [
          {
            field: "platform",
            values: ["urn:li:dataPlatform:kafka"],
            condition: CONTAIN
          }
        ]
      }
    ]
  }) {
    start
    count
    total
    searchResults {
      entity {
        urn
        ... on Dataset {
          name
        }
      }
    }
  }
}

This query searches for all datasets (type: DATASET) that are associated with the Kafka platform (urn:li:dataPlatform:kafka). The query: "*" is used to match all datasets, and the orFilters section specifies the condition to filter datasets by the Kafka platform.

Would you like more details on how to execute this query or any other aspect of using GraphQL with DataHub?

Sources:

Hi :slight_smile: ! Did this interaction resolve your issue or do you still require assistance ?

Please tag @ RunLLM if you still need further assistance !

Or tag @Datahub Community Support if you require a person to take a look :slight_smile:

Hope this helps ! ><