Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 5

GraphQL v4 differences in responses between Explorer and Curl

When using the GraphQL explorer and curl we see different results on searches etc

 

For the following request:

curl 'https://api.github.com/graphql' -H 'Authorization: bearer token' -H 'Content-Type: application/json' -H 'Accept: application/vnd.github.v4+json' --data-binary '{"query":"query {\n  repository(owner: \"connectedhomes\", name: \"bg-rest-api\") {\n    description\n    projects(search: \"Micro services board\", first: 1) {\n      totalCount\n    }\n  }\n}\n","variables":{}}'

 

We get back this response, which is wrong:

{"data":{"repository":{"description":"Rest API for British Gas Online","projects":{"totalCount":0}}}}

 

Whilst using the same query in the Explorer:

query {
  repository(owner: "connectedhomes", name: "bg-rest-api") {
    description
    projects(search: "Micro services board", first:10, states: OPEN) {
      totalCount
    }
  }
}

we get back the following response (which is correct)

{
  "data": {
    "repository": {
      "description": "Rest API for British Gas Online",
      "projects": {
        "totalCount": 1
      }
    }
  }
}

Can someone help me here, as I want to access objects etc that are currently available in preview mode for developers and I cant use the Explorer to get at those data items (ProjectItems specifically). I have seen the same problem with trying to get anything that is a list of items (eg issues) as well 

 

4 Replies
Moderator
Message 2 of 5

Re: GraphQL v4 differences in responses between Explorer and Curl

Hi @czerwina,

 

Thanks for being here! I took your question to another team, and it seems like maybe something is going on locally. We're not sure though, and would love to dig a little deeper. Could you please write us at support@github.com with more details and any other occurrences you've seen? We'll do our best to help you there.

 

Thanks!

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Copilot Lvl 2
Message 3 of 5

Re: GraphQL v4 differences in responses between Explorer and Curl

Hi @nadiajoyce,

Ive already sent a message and had a reply from Veesa Norman. Please hit me up on that email if you want me to run some more tests locally. I was trying to get to some of the test features around GitHub Projects which is the reason i was running the commands locally.

 

Moderator
Message 4 of 5

Re: GraphQL v4 differences in responses between Explorer and Curl

Hi @czerwina Thanks so much for that! We'll continue to work with you via private email on that. Much appreciated for all the info!

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Copilot Lvl 2
Message 5 of 5

Re: GraphQL v4 differences in responses between Explorer and Curl

@czerwina @nadiajoyce Was this ever solved? I am having the same issue.