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: create/mutate users #172

Closed
hendrikeng opened this issue Oct 4, 2018 · 6 comments
Closed

Feature: create/mutate users #172

hendrikeng opened this issue Oct 4, 2018 · 6 comments

Comments

@hendrikeng
Copy link

hendrikeng commented Oct 4, 2018

It would be awesome to be able to mutate/create users and their fields/customfields via craftQl.

Thanks for the awesome work 💯

@hendrikeng hendrikeng changed the title Feature: User Mutations Feature: create Oct 4, 2018
@hendrikeng hendrikeng changed the title Feature: create Feature: create/mutate users Oct 4, 2018
@markhuot
Copy link
Owner

FYI, this is in progress.

markhuot added a commit that referenced this issue Oct 19, 2018
@markhuot
Copy link
Owner

This is now on dev-master. If you're able to try it out you'll want to try something along these lines,

mutation {
  upsertUser(id:1, firstName:"Mark", lastName:"Huot") {
    id
    name # returns `Mark Huot` after the mutation
  }
}

You should be able to inspect the schema via GraphiQL if you're lost. You can search by user ID and edit any default fields as well as any custom fields applied to users. The return of the field is the edited user.

Note: there are new token scopes for this. If you have existing tokens you'll need to re-save the token with the new scopes enabled to make use of the new user mutation.

@j2is
Copy link

j2is commented Nov 7, 2018

Question: Is it possible to mutate/create matrix blocks and elements in general?

@markhuot
Copy link
Owner

markhuot commented Nov 7, 2018

@j2is, can you open a new issue if you still have questions on mutating matrix blocks. It is possible and you should be able to infer the schema from GraphiQL. If you have questions though I'm happy to walk through some sample queries in a new ticket.

@markhuot
Copy link
Owner

Closing this issue. The fix is included in version 1.2.1.

@tristangemus
Copy link

Is there password field support yet?

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

No branches or pull requests

4 participants