Hi Team :wave: Need some help with a GraphQL quer...
# troubleshoot
g
Hi Team 👋 Need some help with a GraphQL query please.... Trying to get a dataset's lineage information but GraphQL is complaining that
"Validation error of type FieldUndefined: Field 'lineage' in type 'Dataset' is undefined @ 'dataset/lineage'"
Query:
Copy code
{
    dataset(urn: "urn:li:dataset:(urn:li:dataPlatform:glue,schema.table,PROD)"){
        urn
        name
        lineage(direction: UPSTREAM, start:0, count:10){
            relationships{
                type
                entity
                degree
            }
        }
    }
}
b
Hmmm. Looks like you need to wrap the arguments in an "input" object
Copy code
{
    dataset(urn: "urn:li:dataset:(urn:li:dataPlatform:glue,schema.table,PROD)"){
        urn
        name
        lineage(input: { direction: UPSTREAM, start:0, count:10 }){
            relationships{
                type
                entity
                degree
            }
        }
    }
}
g
Hey John! Thanks for the idea! I wonder if the
lineage
field is deprecated? It seems the
relationships
field works (found from the
EntityWithRelationships
doc), however I'm getting a new error 😅
Copy code
Query:
{
    dataset(urn: "urn:li:dataset:(urn:li:dataPlatform:glue,schema.table,PROD)"){
        urn
        name
    		relationships(input: {types:["*"], direction:OUTGOING, start:0, count:10 }){
      		relationships{
            type
            direction
            entity{
              urn
            }
          }
    	}
    }
}

result:
{
  "errors": [
    {
      "message": "An unknown error occurred.",
      "locations": [
        {
          "line": 36,
          "column": 7
        }
      ],
      "path": [
        "dataset",
        "relationships"
      ],
      "extensions": {
        "code": 500,
        "type": "SERVER_ERROR",
        "classification": "DataFetchingException"
      }
    }
  ],
  "data": {
    "dataset": {
      "urn": "urn:li:dataset:(urn:li:dataPlatform:glue,schema.table,PROD)",
      "name": "prod.public.kpi_master",
      "relationships": null
    }
  }