Hi, can anyone help with calling the graphql endpo...
# troubleshoot
t
Hi, can anyone help with calling the graphql endpoint from node.js? I can successfully run this query in the GraphiQL web interface:
Copy code
{query : searchAcrossEntities(input: {query: "<our custom property>=<value>"}) { searchResults { entity { ... on Dataset { urn } } } } }
But when I try to send the same query via axios I get an error from datahub JSON:
Copy code
const requestData = {
      "query" : `searchAcrossEntities(input: {query: "<our custom property>=${value}"}) { searchResults { entity { ... on Dataset { urn } } } } `
    }
Error:
Copy code
[{"message":"Invalid Syntax : offending token 'searchAcrossEntities' at line 1 column 1","locations":[{"line":1,"column":1}],"extensions":{"classification":"InvalidSyntax"}}]
1
Solved! For anyone interested, only a small modification was required:
Copy code
const requestData = {
      "query" : `query { searchAcrossEntities(input: {query: "<our custom property>=${value}"}) { searchResults { entity { ... on Dataset { urn } } } } }`
    }