Accounts/GraphQL

Accounts/GraphQL

Methods

(static) "Account.addressBook"(account) → {Promise.<Object>}

converts the addressBook prop on the provided account to a connection

Source:
Parameters:
Name Type Description
account Object

result of the parent resolver, which is an Account object in GraphQL schema format

Returns:

A connection object

Type
Promise.<Object>

(static) "Cart.checkout"(cart) → {Promise.<Object>}

converts the props on the provided cart to an object matching the Checkout GraphQL schema

Source:
Parameters:
Name Type Description
cart Object

result of the parent resolver, which is a Cart object in GraphQL schema format

Returns:

A connection object

Type
Promise.<Object>

(static) "Group.createdBy"(args, _, context) → {Promise.<Object>}

query the Accounts collection and return user account data

Source:
Parameters:
Name Type Description
args Object

an object of all arguments that were sent by the previous resolver

Properties
Name Type Description
createdBy Object

a string account id

_ Object

unused

context Object

an object containing the per-request state

Returns:

user account object

Type
Promise.<Object>

(static) "Mutation.addAccountAddressBookEntry"(parentResult, context) → {Promise.<Object>}

resolver for the addAccountAddressBookEntry GraphQL mutation

Source:
Parameters:
Name Type Description
parentResult Object

unused

args.input Object

an object of all mutation arguments that were sent by the client

Properties
Name Type Attributes Description
accountId String

The account ID

address AddressInput

The address to add

clientMutationId String <optional>

An optional string identifying the mutation call

context Object

an object containing the per-request state

Returns:

AddAccountAddressBookEntryPayload

Type
Promise.<Object>

(static) "Mutation.addAccountToGroup"(parentResult, context) → {Object}

resolver for the addAccountToGroup GraphQL mutation

Source:
Parameters:
Name Type Description
parentResult Object

unused

args.input Object

an object of all mutation arguments that were sent by the client

Properties
Name Type Attributes Description
accountId String

The account ID

groupId String

The group ID

clientMutationId String <optional>

An optional string identifying the mutation call

context Object

an object containing the per-request state

Returns:

AddAccountToGroupPayload

Type
Object

(static) "Mutation.inviteShopMember"(_, context) → {Object}

resolver for the inviteShopMember GraphQL mutation

Source:
Parameters:
Name Type Description
_ Object

unused

args.input Object

an object of all mutation arguments that were sent by the client

Properties
Name Type Attributes Description
email String

The email address of the person to invite

groupId String

The permission group for this person's new account

name String

The permission group for this person's new account

shopId String

The ID of the shop to which you want to invite this person

clientMutationId String <optional>

An optional string identifying the mutation call

context Object

an object containing the per-request state

Returns:

InviteShopMemberPayload

Type
Object

(static) "Mutation.removeAccountAddressBookEntry"(_, context) → {Object}

resolver for the removeAccountAddressBookEntry GraphQL mutation

Source:
Parameters:
Name Type Description
_ Object

unused

args.input Object

an object of all mutation arguments that were sent by the client

Properties
Name Type Attributes Description
accoundId String

The account ID

addressId String

The ID of the address to remove

clientMutationId String <optional>

An optional string identifying the mutation call

context Object

an object containing the per-request state

Returns:

removeAccountAddressBookEntryPayload

Type
Object

(static) "Mutation.removeAccountFromGroup"(_, context) → {Object}

resolver for the removeAccountFromGroup GraphQL mutation

Source:
Parameters:
Name Type Description
_ Object

unused

args.input Object

an object of all mutation arguments that were sent by the client

Properties
Name Type Attributes Description
accountId String

The account ID

groupId String

The group ID

clientMutationId String <optional>

An optional string identifying the mutation call

context Object

an object containing the per-request state

Returns:

RemoveAccountFromGroupPayload

Type
Object

(static) "Mutation.setAccountProfileCurrency"(_, context) → {Object}

resolver for the setAccountProfileCurrency GraphQL mutation

Source:
Parameters:
Name Type Description
_ Object

unused

args.input Object

an object of all mutation arguments that were sent by the client

Properties
Name Type Attributes Description
accoundId String <optional>

The account ID, which defaults to the viewer account

currencyCode String

The currencyCode to add to user profile

clientMutationId String <optional>

An optional string identifying the mutation call

context Object

an object containing the per-request state

Returns:

setAccountProfileCurrency

Type
Object

(static) "Mutation.updateAccountAddressBookEntry"(_, context) → {Object}

resolver for the updateAccountAddressBookEntry GraphQL mutation

Source:
Parameters:
Name Type Description
_ Object

unused

args.input Object

an object of all mutation arguments that were sent by the client

Properties
Name Type Attributes Description
accountId String

optional opaque ID of account on which entry should be updated, for admins

addressId String

opaque ID of the address to edit

updates Object

updated address object, in GraphQL schema format

type String

If present, make this address the default address of this type (billing or shipping)

clientMutationId String <optional>

An optional string identifying the mutation call

context Object

an object containing the per-request state

Returns:

UpdateAccountAddressBookEntryPayload

Type
Object

(static) "Query.account"(_, args, context) → {Promise.<Object>}

query the Accounts collection and return user account data

Source:
Parameters:
Name Type Description
_ Object

unused

args Object

an object of all arguments that were sent by the client

Properties
Name Type Description
id String

id of user to query

context Object

an object containing the per-request state

Returns:

user account object

Type
Promise.<Object>

(static) "Query.administrators"(_, args, context) → {Promise.<Array.<Object>>}

find and return the administrators (users with "admin" or "owner" role) for a shop

Source:
Parameters:
Name Type Description
_ Object

unused

args ConnectionArgs

an object of all arguments that were sent by the client

context Object

an object containing the per-request state

Returns:

Promise that resolves with array of user account objects

Type
Promise.<Array.<Object>>

(static) "Query.group"(_, args, context) → {Promise.<Object>}

query the Groups collection and return a group by id

Source:
Parameters:
Name Type Description
_ Object

unused

args Object

an object of all arguments that were sent by the client

Properties
Name Type Description
id String

id of group to query

context Object

an object containing the per-request state

Returns:

group object

Type
Promise.<Object>

(static) "Query.groups"(_, args, context) → {Promise.<Array.<Object>>}

find and return the administrators (users with "admin" or "owner" role) for a shop

Source:
Parameters:
Name Type Description
_ Object

unused

args GroupConnectionArgs

an object of all arguments that were sent by the client. See default connection arguments

context Object

an object containing the per-request state

Returns:

an array of user Group objects

Type
Promise.<Array.<Object>>

(static) "Query.roles"(_, args, context) → {Promise.<Array.<Object>>}

find and return the roles for a shop

Source:
Parameters:
Name Type Description
_ Object

unused

args ConnectionArgs

an object of all arguments that were sent by the client

context Object

an object containing the per-request state

Returns:

Promise that resolves with array of user Roles objects

Type
Promise.<Array.<Object>>

(static) "Query.viewer"(_, args, context) → {Object}

query the Accounts collection and return user account data for the current user

Source:
Parameters:
Name Type Description
_ Object

unused

args Object

an object of all arguments that were sent by the client

context Object

an object containing the per-request state

Returns:

user account object

Type
Object

Type Definitions

GroupConnectionArgs

Arguments passed by the client a groups query

.

Source:
Properties:
Name Type Description
args ConnectionArgs

An object of all arguments that were sent by the client. See default connection arguments

Properties
Name Type Description
shopId String

The id of shop to filter groups by

sortBy Number

Sort results by a GroupSortByField enum value of _id, name, createdAt, or updatedAt

Arguments passed by the client a groups query

Type:
  • ConnectionArgs