-
-
Notifications
You must be signed in to change notification settings - Fork 598
Add support of GraphQL variables #612
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
Conversation
lib/Github/Api/GraphQL.php
Outdated
* | ||
* @return array | ||
*/ | ||
public function execute($query) | ||
public function execute($query, array $variables = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the default value to an emtpy array, this way each possible value (user input or default) is the same type
One small comment, the rest of the PR looks good to me! |
- fixed default value to be same type if not specified
@acrobat, agree that with an empty array as the default value code will be more maintainable in future. Fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. It looks good with tests and everything =)
Just add a small note in the change log and we'll be happy to merge.
Added item to |
Thanks @vkublytskyi! And congrats on your first contribution on this library! |
GitHub GraphQL API supports variables that allow specifying of requested data without dynamical change of a query on a client side.
This PR adds the possibility to send variables with a query to GitHub GraphQL API v4.
Usage: