Discussions
Error received: {"errors":[{"message":"Field 'companyName' doesn't exist on type 'CompanyConnection'","locations":[{"line":5,"column":5}],"path":["query","leads","companyName"],"extensions":{"code":"undefinedField","typeName":"CompanyConnection","fieldName":"companyName"}}]}
8 months ago by Rishabh Rajpurohit
I was running a leads query using python requests, it looks like this:
import requests
import json
url = "https://api.stackshare.io/graphql?access_token=<MY_API_KEY>"
headers = {
"accept": "application/json",
"x-api-key": "",
}
query = """
query ($toolMatch: String!, $usingToolSlugs: [String!]!) {
leads(toolMatch: $toolMatch, usingToolSlugs: $usingToolSlugs) {
#companyId
companyName
#domain
#companyTools
}
}
"""
variables = {
"toolMatch": "match_all",
"usingToolSlugs": ["Grails"]
}
response = requests.post(url, headers=headers, json={'query': query, 'variables': variables})
print(response.text)