mirror of
https://github.com/strapi/strapi.git
synced 2025-08-06 07:50:02 +00:00
Merge pull request #2116 from NickBolles/njb/add-me-graphql-query
Add Graphql Query For The Current User
This commit is contained in:
commit
22a21b51cc
@ -2,8 +2,35 @@ module.exports = {
|
||||
type: {
|
||||
UsersPermissionsPermission: false // Make this type NOT queriable.
|
||||
},
|
||||
definition: `
|
||||
type UsersPermissionsMe {
|
||||
_id: ID!
|
||||
username: String!
|
||||
email: String!
|
||||
confirmed: Boolean
|
||||
blocked: Boolean
|
||||
role: UsersPermissionsMeRole
|
||||
}
|
||||
|
||||
type UsersPermissionsMeRole {
|
||||
_id: ID!
|
||||
name: String!
|
||||
description: String
|
||||
type: String
|
||||
}
|
||||
`,
|
||||
query: `
|
||||
me: UsersPermissionsMe
|
||||
`,
|
||||
resolver: {
|
||||
Query: {
|
||||
me: {
|
||||
resolverOf: 'User.me',
|
||||
resolver: {
|
||||
plugin: 'users-permissions',
|
||||
handler: 'User.me'
|
||||
}
|
||||
},
|
||||
role: {
|
||||
resolverOf: 'UsersPermissions.getRole',
|
||||
resolver: async (obj, options, ctx) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user