Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.14] GraphQL API #772

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Coding standards
  • Loading branch information
claudiu-cristea committed Aug 21, 2023
commit 23b7f9885b30a11929ccd1222ac070288fa10b3c
8 changes: 4 additions & 4 deletions src/Api/GraphQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class GraphQL extends AbstractApi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have a few test cases.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should. But I have no time to work on

{
/**
* @inheritDoc
* {@inheritDoc}
*/
protected const URI_PREFIX = '/api/';

Expand All @@ -35,7 +35,7 @@ public function execute(string $query, array $variables = [])
'query' => $query,
];
if (!empty($variables)) {
$params['variables'] = json_encode($variables);
$params['variables'] = \json_encode($variables);
}

return $this->post('/graphql', $params);
Expand All @@ -49,6 +49,6 @@ public function execute(string $query, array $variables = [])
*/
public function fromFile(string $file, array $variables = [])
{
return $this->execute(file_get_contents($file), $variables);
return $this->execute(\file_get_contents($file), $variables);
}
}
}