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
Next Next commit
Make URI_PREFIX protected
  • Loading branch information
claudiu-cristea committed Aug 21, 2023
commit 0421470a01396dfb81c914b22303575f279ced50
2 changes: 1 addition & 1 deletion src/Api/AbstractApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ abstract class AbstractApi
*
* @var string
*/
private const URI_PREFIX = '/api/v4/';
protected const URI_PREFIX = '/api/v4/';

Choose a reason for hiding this comment

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

Do you really need to change this? Since you're using static now, it should automatically use the one from the child class, no? 🤔

Copy link
Author

Choose a reason for hiding this comment

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

In PHP private means a sub-class cannot extend/override it.

Copy link
Member

Choose a reason for hiding this comment

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

why does it need to be overwritten? the changes you want don't need to re-use this?

Copy link
Author

Choose a reason for hiding this comment

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

@GrahamCampbell, GraphQL is versionless. The URL prefix is /api instead of /api/v4, so AbstractApi::prepareUriP(), needs to get /api when subclassed as \Gitlab\Api\GraphQL

Copy link
Author

Choose a reason for hiding this comment

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

Maybe we should split version out of URI_PREFIX, into a protected class? Then we override the version in GraphQL as GitLab GraphQL is versionless


/**
* The access levels for groups and projects
Expand Down