GraphQL Cookbook
Signing up
6 min
signing up a user through the parse graphql api problem you want to sign up a new user in your backend through the parse graphql api solution using the parse graphql api, you can sign up a new user just by sending the user’s data through the signup signup mutation the username username and password password fields are mandatory the mutation will return back not only the objectid objectid and createdat createdat fields (that are returned by default when creating an object https //www back4app com/docs/parse graphql/graphql mutation create object ), but also the sessiontoken sessiontoken after signing up a new user, you can use the authenticating a user https //www back4app com/docs/parse graphql/graphql user authentication recipe to send the sessiontoken sessiontoken in the following operations so they will be executed in the behavior of this user you can also use the logging in https //www back4app com/docs/parse graphql/graphql login recipe to log in the user by using the defined credentials and the logging out https //www back4app com/docs/parse graphql/graphql logout mutation recipe to destroy the sessiontoken sessiontoken version information depending on the version of parse you choose to run, the graphql queries, mutations and results will be slightly different please choose the correct example along with the parse version you are running parse server 4 2 0 and later request 1 mutation signup{ 2 signup(input { 3 fields { 4 username "somefolk" 5 password "somepassword" 6 } 7 }){ 8 viewer{ 9 user{ 10 id 11 createdat 12 } 13 sessiontoken 14 } 15 } 16 } response 1 { 2 "data" { 3 "signup" { 4 "viewer" { 5 "user" { 6 "id" "x1vzzxi6ckzwbdr3yljuca==", 7 "createdat" "2020 02 06t13 38 04 517z" 8 }, 9 "sessiontoken" "r 3233bc3b6801a15bcda39ff250416143" 10 } 11 } 12 } 13 } older parse server versions parse server 3 10 0 and later request 1 mutation signup{ 2 signup(input { 3 userfields { 4 username "somefolk" 5 password "somepassword" 6 } 7 }){ 8 viewer{ 9 user{ 10 id 11 createdat 12 } 13 sessiontoken 14 } 15 } 16 } response 1 { 2 "data" { 3 "signup" { 4 "viewer" { 5 "user" { 6 "id" "x1vzzxi6uhnoukj3y1yyrq==", 7 "createdat" "2020 02 06t13 38 04 517z" 8 }, 9 "sessiontoken" "r\ c7abf06d951e8087c00fa66d546d1fea" 10 } 11 } 12 } 13 } parse server 3 9 0 request 1 mutation signup{ 2 signup(fields { 3 username "somefolk" 4 password "somepassword" 5 }){ 6 id 7 createdat 8 sessiontoken 9 } 10 } response 1 { 2 "data" { 3 "signup" { 4 "id" "gx2zw7yeny", 5 "createdat" "2019 11 04t14 24 21 333z", 6 "sessiontoken" "r 6d5f75f0f2d9ee16077b0a0ff1e20eb2" 7 } 8 } 9 } parse server 3 8 0 request 1 mutation signup{ 2 signup(fields { 3 username "somefolk" 4 password "somepassword" 5 }){ 6 objectid 7 createdat 8 } 9 } response 1 { 2 "data" { 3 "signup" { 4 "objectid" "ktznkvzto2", 5 "createdat" "2019 11 04t14 23 46 014z", 6 "sessiontoken" "r 2ca6914312ed16803cf3769a25934cdc" 7 } 8 } 9 } parse server 3 7 2 request 1 mutation signup { 2 users { 3 signup(fields { username "somefolk", password "somepassword" }) { 4 objectid, 5 createdat, 6 sessiontoken 7 } 8 } 9 } response 1 { 2 "data" { 3 "users" { 4 "signup" { 5 "objectid" "nyu1lnlhpd", 6 "createdat" "2019 07 29t09 09 58 222z", 7 "sessiontoken" "r\ a86665f0b63d9d8f945e4b0f302a1655" 8 } 9 } 10 } 11 }