Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

To receive error messages when creating a user, make sure to add the errors in the return object as seen below in the query example.

...

Example

Code Block
mutation {
  createUser(
    input: {
      user: {
        firstName:<STRING> "Luke",
        lastName:<STRING> "Skywalker",
        credentials: {
          username: <STRING>"luke_skywalker",
          password: <STRING>"womprats!1977"
        },
        email: <STRING>"luke.skywalker@jedi.org"
        },
      requestedOriginGroup: <STRING>"DEFAULT"
      requestedLicenses: Array<LicenseType.ENUM>[VIEWER],
      requestedGroups: Array<STRING>["DEFAULT", "JEDI"]
      ) {
    errors {
      path
      message
      fullMessage
    }
    user {
      id
      username
      email
    }
  }
}

...

Code Block
{
  "first": 1,
  "fullText": "luke@jedi.org"
}

Query

Code Block
query FetchMembers($fullText: String, $first: Int!) {
  viewer {
    currentOrganization {
      members(fullText: $fullText, first: $first)
        {
        nodes {
          firstName
          lastName
          username
          email
        }
      }              
    }
  }
}

...

This query uses the users query field, which is available on v2.28.1 and above.

Query

Code Block
{
  users(
      fullText: "luke@jedi.org"
      first: 1
  )
   {
    errors {
      fullMessage
    }
    nodes {
      id
      firstName
      lastName
      username
      email
    }
    totalCount
  }
}

...

Code Block
{
  "input": {
    "id": <STRING>,
    "requestedGroups": Array<STRING>,
    "requestedLicenses": Array<STRING>,
    "requestedOriginGroup": <STRING>,
    "user": {
      "email": <STRING>,
      "firstName": <STRING>,
      "lastName": <STRING>,
      "phone": <STRING>,
      "jobTitle": <STRING>
    }
  }
}

Query

Code Block
mutation updateUser($input: UpdateUserMutationInput!) {
  updateUser(input: $input) {
    user {
      id
      email
      firstName
      lastName
      phone
      jobTitle
      licenses {
        nodes {
          licenseType
        }
      }
      groups {
        nodes {
          name
        }
      }
    }
    errors {
      fullMessage
    }
    success
  }
}

...

Code Block
languagejson
{"input": {"ids": Array<String> } }

Query

Code Block
 mutation deleteUsers($input: DeleteUsersMutationInput!) {
  deleteUsers(input: $input) {
    errors {
      fullMessage
    }
    success
    undeletedItems {
      id
      name
    }
  }
}

...