Skip to content

Commit 6362281

Browse files
authored
Allow costume accept headers for GraphQL Endpoint.
Github has multiple different accept headers for different purposes. Currently, there's no easy way to add/remove the `Accept` header to the client. ref: https://docs.github.com/en/graphql/overview/schema-previews
1 parent 1dce0d3 commit 6362281

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Github/Api/GraphQL.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ class GraphQL extends AbstractApi
2121
*
2222
* @return array
2323
*/
24-
public function execute($query, array $variables = [])
24+
public function execute($query, array $variables = [], $acceptHeaderValue = 'application/vnd.github.v4+json')
2525
{
26-
$this->acceptHeaderValue = 'application/vnd.github.v4+json';
26+
$this->acceptHeaderValue = $acceptHeaderValue;
2727
$params = [
2828
'query' => $query,
2929
];

0 commit comments

Comments
 (0)