GraphQL Account API Reference

GraphQL Account API Reference

Queries

account

Description

An account.

Response

Returns an Account!

Example

Query
query account {
  account {
    accountInfo {
      ...AccountInfoFragment
    }
    apps {
      ...AppsConnectionFragment
    }
    id
    stores {
      ...StoreConnectionFragment
    }
    users {
      ...UserConnectionFragment
    }
  }
}
Response
{
  "data": {
    "account": {
      "accountInfo": AccountInfo,
      "apps": AppsConnection,
      "id": 4,
      "stores": StoreConnection,
      "users": UserConnection
    }
  }
}

node

Description

Fetches an object given its ID.

Response

Returns a Node

Arguments
Name Description
id - ID! The ID of the object.

Example

Query
query node($id: ID!) {
  node(id: $id) {
    id
  }
}
Variables
{"id": "4"}
Response
{"data": {"node": {"id": "4"}}}

nodes

Description

Fetches objects given their IDs.

Response

Returns [Node]!

Arguments
Name Description
ids - [ID!]! The IDs of the objects.

Example

Query
query nodes($ids: [ID!]!) {
  nodes(ids: $ids) {
    id
  }
}
Variables
{"ids": ["4"]}
Response
{"data": {"nodes": [{"id": 4}]}}

system

Description

System settings.

Response

Returns a System!

Example

Query
query system {
  system {
    time
  }
}
Response
{"data": {"system": {"time": {}}}}

Mutations

account

Description

Account mutations.

Response

Returns an AccountMutations!

Example

Query
mutation account {
  account {
    addUserToAccount {
      ...AddUserToAccountResultFragment
    }
    removeUserFromAccount {
      ...RemoveUserFromAccountResultFragment
    }
  }
}
Response
{
  "data": {
    "account": {
      "addUserToAccount": AddUserToAccountResult,
      "removeUserFromAccount": RemoveUserFromAccountResult
    }
  }
}

user

Description

User mutations.

Response

Returns a UserMutations!

Example

Query
mutation user {
  user {
    addUserToStore {
      ...AddUserToStoreResultFragment
    }
    createUserWithPassword {
      ...CreateUserWithPasswordResultFragment
    }
    removeUserFromStore {
      ...RemoveUserFromStoreResultFragment
    }
  }
}
Response
{
  "data": {
    "user": {
      "addUserToStore": AddUserToStoreResult,
      "createUserWithPassword": CreateUserWithPasswordResult,
      "removeUserFromStore": RemoveUserFromStoreResult
    }
  }
}

Types

Account

Description

An account.

Fields
Field Name Description
accountInfo - AccountInfo! Provides account details.
apps - AppsConnection! Apps owned by the account.
Arguments
before - String
after - String
first - Int
last - Int
id - ID! The ID of the object.
stores - StoreConnection! The stores related to an account.
Arguments
before - String
after - String
first - Int
last - Int
users - UserConnection! Users belonging to the account.
Arguments
before - String
after - String
first - Int
last - Int
Example
{
  "accountInfo": AccountInfo,
  "apps": AppsConnection,
  "id": "4",
  "stores": StoreConnection,
  "users": UserConnection
}

AccountInfo

Description

Account details.

Fields
Field Name Description
name - String! The name of an account.
Example
{"name": "xyz789"}

AccountMutations

Description

Account mutations.

Fields
Field Name Description
addUserToAccount - AddUserToAccountResult Adds a user to an account.
Arguments
removeUserFromAccount - RemoveUserFromAccountResult Removes a user from an account.
Arguments
Example
{
  "addUserToAccount": AddUserToAccountResult,
  "removeUserFromAccount": RemoveUserFromAccountResult
}

AddUserToAccountInput

Fields
Input Field Description
email - String! The email of the user to be added to the account.
Example
{"email": "xyz789"}

AddUserToAccountResult

Fields
Field Name Description
account - Account An account the user was added to.
Example
{"account": Account}

AddUserToStoreInput

Fields
Input Field Description
storeId - ID! The store the user is to be added.
user - UserIdentifierInput! The user to be added to the store.
Example
{
  "storeId": "4",
  "user": UserIdentifierInput
}

AddUserToStoreResult

Fields
Field Name Description
storeId - ID! The ID of the object.
Example
{"storeId": 4}

App

Description

An application.

Fields
Field Name Description
id - ID! The ID of the object.
name - String! The app name.
Example
{"id": 4, "name": "abc123"}

AppsConnection

Description

A connection to a list of items.

Fields
Field Name Description
pageInfo - PageInfo! Information to aid in pagination.
edges - [AppsEdge] A list of edges.
Example
{
  "pageInfo": PageInfo,
  "edges": [AppsEdge]
}

AppsEdge

Description

An edge in a connection.

Fields
Field Name Description
node - App! The item at the end of the edge.
cursor - String! A cursor for use in pagination.
Example
{
  "node": App,
  "cursor": "xyz789"
}

Boolean

Description

The Boolean scalar type represents true or false.

Example
true

CreateUserWithPasswordInput

Fields
Input Field Description
email - String! The email of the user to be added to the account.
firstName - String! The first name of the user to be added to the account.
lastName - String! The last name of the user to be added to the account.
locale - String! The locale of the user to be added to the account.
password - String! The password of the user to be added to the account.
passwordConfirmation - String! Enter password again to confirm.
Example
{
  "email": "xyz789",
  "firstName": "xyz789",
  "lastName": "xyz789",
  "locale": "xyz789",
  "password": "abc123",
  "passwordConfirmation": "xyz789"
}

CreateUserWithPasswordResult

Fields
Field Name Description
user - User Created user.
Example
{"user": User}

DateTime

Description

ISO-8601 formatted date in UTC

Example
"2007-12-03T10:15:30Z"

ID

Description

The ID scalar type represents a unique identifier, often used to re-fetch an object or as key for a cache.

Example
"4"

Int

Description

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
123

Long

Description

The Long scalar type represents non-fractional signed whole numeric values. Long can represent values between -(2^63) and 2^63 - 1.

Example
{}

Node

Description

An object with an ID.

Fields
Field Name Description
id - ID! The ID of the object.
Example
{"id": "4"}

PageInfo

Description

Information about pagination in a connection.

Fields
Field Name Description
hasNextPage - Boolean! When paginating forwards, are there more items?
hasPreviousPage - Boolean! When paginating backwards, are there more items?
startCursor - String When paginating backwards, the cursor to continue.
endCursor - String When paginating forwards, the cursor to continue.
Example
{
  "hasNextPage": true,
  "hasPreviousPage": false,
  "startCursor": "abc123",
  "endCursor": "xyz789"
}

RemoveUserFromAccountInput

Description

Input needed to remove a user from an account.

Fields
Input Field Description
email - String The email of the user to be removed from the account.
userId - ID The id of the user to be removed.
Example
{"email": "abc123", "userId": 4}

RemoveUserFromAccountResult

Fields
Field Name Description
accountId - ID! The ID of the object.
userId - ID! The ID of the object.
Example
{"accountId": 4, "userId": 4}

RemoveUserFromStoreInput

Fields
Input Field Description
storeId - ID! The store from which user is to be removed.
userId - ID! The user to be removed.
Example
{"storeId": 4, "userId": 4}

RemoveUserFromStoreResult

Fields
Field Name Description
storeId - ID! The store from which the user is removed from.
user - User Removed user.
Example
{"storeId": 4, "user": User}

Store

Description

A store related to an account.

Fields
Field Name Description
id - ID! The ID of the object.
apps - AppsConnection! The list of store apps.
Arguments
before - String
after - String
first - Int
last - Int
name - String! The store name for the store.
storeHash - String! The store hash for the store.
users - StoreUserConnection! Users belonging to the store.
Arguments
before - String
after - String
first - Int
last - Int
Example
{
  "id": 4,
  "apps": AppsConnection,
  "name": "xyz789",
  "storeHash": "xyz789",
  "users": StoreUserConnection
}

StoreConnection

Description

A connection to a list of items.

Fields
Field Name Description
pageInfo - PageInfo! Information to aid in pagination.
edges - [StoreEdge] A list of edges.
Example
{
  "pageInfo": PageInfo,
  "edges": [StoreEdge]
}

StoreEdge

Description

An edge in a connection.

Fields
Field Name Description
node - Store! The item at the end of the edge.
cursor - String! A cursor for use in pagination.
Example
{
  "node": Store,
  "cursor": "xyz789"
}

StoreUser

Description

A user belonging to an store.

Fields
Field Name Description
id - ID! The ID of the object.
apps - AppsConnection! Apps accessible by the user on the store.
Arguments
before - String
after - String
first - Int
last - Int
email - String! The email for the user.
firstName - String! First name.
lastLoginAt - DateTime When the user last logged in.
lastName - String! Last name.
locale - String! User preferred locale.
permissions - [String!]! The permissions for the user on the store.
status - StoreUserStatus Current status of the user for the store.
updatedAt - DateTime When was the user last updated.
Example
{
  "id": "4",
  "apps": AppsConnection,
  "email": "xyz789",
  "firstName": "xyz789",
  "lastLoginAt": "2007-12-03T10:15:30Z",
  "lastName": "abc123",
  "locale": "abc123",
  "permissions": ["abc123"],
  "status": "ACTIVE",
  "updatedAt": "2007-12-03T10:15:30Z"
}

StoreUserConnection

Description

A connection to a list of items.

Fields
Field Name Description
pageInfo - PageInfo! Information to aid in pagination.
edges - [StoreUserEdge] A list of edges.
Example
{
  "pageInfo": PageInfo,
  "edges": [StoreUserEdge]
}

StoreUserEdge

Description

An edge in a connection.

Fields
Field Name Description
node - StoreUser! The item at the end of the edge.
cursor - String! A cursor for use in pagination.
Example
{
  "node": StoreUser,
  "cursor": "abc123"
}

StoreUserStatus

Description

The status of the user on the store.

Values
Enum Value Description

ACTIVE

The user is active.

INACTIVE

The user is inactive.
Example
"ACTIVE"

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"xyz789"

System

Description

System settings.

Fields
Field Name Description
time - Long! The current time.
Example
{"time": {}}

User

Description

A user belonging to an account.

Fields
Field Name Description
id - ID! The ID of the object.
email - String! The email for the user.
firstName - String! First name.
lastName - String! Last name.
locale - String! User preferred locale.
Example
{
  "id": 4,
  "email": "abc123",
  "firstName": "abc123",
  "lastName": "abc123",
  "locale": "abc123"
}

UserConnection

Description

A connection to a list of items.

Fields
Field Name Description
pageInfo - PageInfo! Information to aid in pagination.
edges - [UserEdge] A list of edges.
Example
{
  "pageInfo": PageInfo,
  "edges": [UserEdge]
}

UserEdge

Description

An edge in a connection.

Fields
Field Name Description
node - User! The item at the end of the edge.
cursor - String! A cursor for use in pagination.
Example
{
  "node": User,
  "cursor": "xyz789"
}

UserIdentifierInput

Description

The user to add to the store.

Fields
Input Field Description
email - String The email of the user to be added to the store.
id - ID The ID of the user to be added.
Example
{"email": "abc123", "id": 4}

UserMutations

Description

User mutations.

Fields
Field Name Description
addUserToStore - AddUserToStoreResult Adds a user to a store.
Arguments
createUserWithPassword - CreateUserWithPasswordResult Creates a user with password.
Arguments
removeUserFromStore - RemoveUserFromStoreResult Removes user from a store.
Arguments
Example
{
  "addUserToStore": AddUserToStoreResult,
  "createUserWithPassword": CreateUserWithPasswordResult,
  "removeUserFromStore": RemoveUserFromStoreResult
}