Hi all, I'm running the following query to fetch s...
# getting-started
s
Hi all, I'm running the following query to fetch schemafield information.
Copy code
{
  search(input: {type: DATASET , query: "mig6", start: 0, count: 100}) {
    searchResults {
      entity {
        ... on Dataset {
          urn
          type
          schemaMetadata{version fields { fieldPath label nullable type nativeDataType description glossaryTerms{terms{associatedUrn term{urn properties {
            description
            sourceRef
            sourceUrl
            rawSchema
          }}}} tags { tags { tag { urn properties { name }}}}} primaryKeys}
        }
      }
    }
  }
}
I expect a list of terms associated to some fields but it does not return anything. In the openapi I do receive the assigned glossary terms. Anyone else experiencing this issue? I get the same results in the demo environment. Not sure if I'm maybe not formatting the graphql query properly.
l
Hey there 👋 I'm The DataHub Community Support bot. I'm here to help make sure the community can best support you with your request. Let's double check a few things first: 1️⃣ There's a lot of good information on our docs site: www.datahubproject.io/docs, Have you searched there for a solution? Yes button 2️⃣ It's not uncommon that someone has run into your exact problem before in the community. Have you searched Slack for similar issues? Yes button
b
Hi there!
This is because there are actually 2 sets of glossary terms for a given field: The ones provided at ingestion time, and those provided via the UI (a bit strange, admittedly). To fetch those which were added via the UI, you can use the editableSchemaMetadata field in your query
Copy code
{
  search(input: {type: DATASET , query: "mig6", start: 0, count: 100}) {
    searchResults {
      entity {
        ... on Dataset {
          urn
          type
          editableSchemaMetadata { editableSchemaFieldInfo{ glossaryTerms { ... } } }
        }
      }
    }
  }
}
s
@big-carpet-38439 thanks! Always wondered why there were 2 schemaMetadata references. That's clear now thanks!