Current User (Me)
me returns information about the account behind the current request. Use it to read identity details and to check what the current user is allowed to do before offering an action in your integration.
me is not a root query field — it lives under the user namespace:
query {
user {
me {
permitted
canCreateOrg
hasOrganizations
user {
id
name
primaryEmail
}
}
}
}Fields
permitted
Boolean!
Whether the account is allowed to use the application at all. false means the caller authenticated successfully but is not permitted access — data operations return ACCESS_NOT_PERMITTED.
hasOrganizations
Boolean!
Whether the account belongs to at least one organization. Useful for hiding actions that require an organization to exist — creating a library, for example.
user
User
The caller's own user record, or null when no user record exists yet for the token.
Identity fields live on user, not on Me itself. Note that the User type exposes primaryEmail (a String!) and emails — there is no email field.
Checking whether a user can create an organization
Creating a new organization in Duro is gated: not every account is permitted to do so. Rather than attempting the mutation and handling a failure, query canCreateOrg first and use it to enable or hide a "New organization" affordance in your UI.
canCreateOrg: Boolean!
Returns true when the current user is allowed to create a new organization right now, and false otherwise.
In deployments where organization-creation gating is not enforced, the gate is a no-op and canCreateOrg is true for every authenticated caller. Do not read a true here as evidence that a grant exists.
Where gating is enforced, canCreateOrg is true for a non-archived caller who either:
holds a live, unused organization-creation grant issued to their verified email address, or
is the Site Admin of at least one active production organization, and so may create a sandbox organization beneath it. This applies only where sandbox entitlements are also enforced.
It is false when neither holds — when the user has no grant, when their grant has already been used or was revoked, or when they administer no organization that can parent a sandbox. Those conditions surface as org-creation error codes if a create is attempted anyway.
Updating your own profile
Profile edits are self-service only: a caller may update their own user record and no one else's. Use updateMe, which takes no user id — the target is resolved from the authenticated caller.
updateMe(input: UpdateUserInput!): User!
The mutation returns the updated User. See UpdateUserInput in Apollo Explorer for the full set of editable fields.
Deprecated: update(id: String!, input: UpdateUserInput!): User!
update is the older, id-based form of the same operation. It is deprecated in favor of updateMe:
Use
updateMeinstead. Theidargument is redundant and is rejected unless it matches the caller.
update still works, so no migration deadline applies today, but the id argument buys you nothing: passing another user's id is refused rather than editing that account. Move existing callers to updateMe and drop the id.
Last updated
Was this helpful?