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

Feature/444 - Adding entry point for querying user roles #463

Merged
merged 11 commits into from
Jul 9, 2018

Conversation

CodeProKid
Copy link
Member

Your checklist for this pull request

Thanks for sending a pull request! Please make sure you click the link above to view the contribution guidelines, then fill out the blanks below.

🚨Please review the guidelines for contributing to this repository.

  • Make sure you are making a pull request against the develop branch (left side). Also you should start your branch off our develop.
  • Make sure you are requesting to pull request from a topic/feature/bugfix branch (right side). Don't pull request from your master!

What does this implement/fix? Explain your changes.

Implements queries for User Roles

Does this close any currently open issues?

closes #444

Any relevant logs, error output, GraphiQL screenshots, etc?

Example query for getting all roles:

query {
	userRoles{
		edges {
			node {
				name
				capabilities
				id
			}
		}
	}
}

Example query for getting info on a single role:

query {
	userRole(id: "cm9sZTphZG1pbmlzdHJhdG9y"){
		id
		name
		capabilities
	}
}

Any other comments?

There are some new autoloader files in here that weren't previously in the repo. I don't think I did anything weird to have these generated, not sure if it's just because I'm on a different version of composer or what though.

Where has this been tested?

Operating System:

WordPress Version: 4.9.6

@CodeProKid
Copy link
Member Author

Sooooo, I ran composer dump-autoload and I think that somehow made things worse? 😆 looks like it's loading the dev deps too 😬

@jasonbahl
Copy link
Collaborator

@CodeProKid try running:

rm -rf vendor
rm -rf composer.lock
composer install --no-dev

@CodeProKid
Copy link
Member Author

@jasonbahl looks like build is passing now. Wanna take a look when you get a chance?

composer.lock Outdated
@@ -7376,4 +7376,4 @@
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

😭

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, my IDE has been doing that on some files. I'll check it out.

Copy link
Contributor

@hughdevore hughdevore left a comment

Choose a reason for hiding this comment

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

@CodeProKid, one tiny thing but this looks great 👏


}

public static function resolve_user_role_connection( $source, array $args, AppContext $context, ResolveInfo $info ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Need a doc block here

@jasonbahl
Copy link
Collaborator

I'm pulling this locally to check some things out as well.

@CodeProKid
Copy link
Member Author

@hughdevore & @jasonbahl this should be fixed up now 👍

@jasonbahl jasonbahl merged commit 1330887 into wp-graphql:develop Jul 9, 2018
@jasonbahl
Copy link
Collaborator

@CodeProKid good work. got this merged 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add userRoles entry point
3 participants