Shopify SDK for Unity
|
ShopifyClient is the entry point to communicate with the Shopify Storefront API. ShopifyClient also has functionality to easily generate and send queries to receive information about products, collections, and has the ability to create checkouts. More...
Public Member Functions | |
ShopifyClient (string accessToken, string domain, string locale=null) | |
ShopifyClient is the entry point to communicate with the Shopify Storefront API. ShopifyClient also has functionality to easily generate and send queries to receive information about products and collections. It also has the ability to create checkouts. More... | |
ShopifyClient (BaseLoader loader) | |
It is possible to instantiate a ShopifyClient by passing an instance that implements BaseLoader . BaseLoaders handle network communication with the Storefront API. This functionality is useful if you'd like to use the Shopify SDK for Unity in a C# environment outside of Unity. The domain string is inferred from BaseLoaders which can be used to request a specific client. More... | |
void | UpdateLocale (string locale) |
Overwrites the QueryLoader instance with a new one with the specified locale. More... | |
void | products (ProductsPaginatedHandler callback, int? first=null, string after=null) |
Generates a query to receive one page of products from a Shopify store. The generated query will query the following on products: More... | |
void | products (ProductsHandler callback, string firstProductId, params string[] otherProductIds) |
Generates a query to receive selected products from a Shopify store. The generated query will query the following on products: More... | |
void | products (ProductsHandler callback, List< string > productIds) |
Generates a query to receive selected products from a Shopify store. The generated query will query the following on products: More... | |
void | collections (CollectionsPaginatedHandler callback, int? first=null, string after=null) |
Generates a query to receive a page of collections from a Shopify store. The generated query will query the following on collections: More... | |
void | collections (CollectionsHandler callback, string firstCollectionId, params string[] otherCollectionIds) |
Generates a query to receive selected collections from a Shopify store. The generated query will query the following on collections: More... | |
void | collections (CollectionsHandler callback, List< string > collectionIds) |
Generates a query to fetch the specified collections by id from a Shopify store. The generated query will query the following on collections: More... | |
void | Query (QueryRootQuery query, QueryRootHandler callback) |
Allows you to send custom GraphQL queries to the Storefront API. While having utility functions like products collections is useful, the Storefront API has more functionality. This method allows you to access all the extra functionality that the Storefront API provides. More... | |
void | Query (QueryRootDelegate buildQuery, QueryRootHandler callback) |
Allows you to build and send custom GraphQL queries to the Storefront API. While having utility functions like products collections is useful, the Storefront API has more functionality. This method allows you to access all the extra functionality that the Storefront API provides. More... | |
void | Mutation (MutationQuery query, MutationRootHandler callback) |
Allows you to continuously make a root query, till the response is deemed ready. More... | |
void | Mutation (MutationDelegate buildQuery, MutationRootHandler callback) |
Allows you to build and send custom GraphQL mutation queries to the Storefront API. More... | |
Cart | Cart (string cartId=null) |
Creates a Cart , which can be used to manage line items for an order and create a web checkout link. One client can have multiple carts, so it's possible to pass in a cartId to reference a specific cart. If no cartId is passed, then a default Cart is used. More... | |
Static Public Attributes | |
static Dictionary< string, int > | DefaultImageResolutions |
This is a dictionary that defines aliases, maxWidth , and maxHeight for images loaded by products and collections . All Products images, Product variant images, and Collection images will be queried using aliases defined by this dictionary's keys and the maxWidth and maxHeight will be this dictionary's values. More... | |
Properties | |
string | AccessToken [get] |
AccessToken is the access token associated with this client to query Shopify. More... | |
string | Domain [get] |
Domain is the Shopify store domain associated with this client. More... | |
string | Locale [get] |
Locale is the language that supported translated content will be in. More... | |
ShopifyClient is the entry point to communicate with the Shopify Storefront API. ShopifyClient also has functionality to easily generate and send queries to receive information about products, collections, and has the ability to create checkouts.
|
inline |
ShopifyClient is the entry point to communicate with the Shopify Storefront API. ShopifyClient also has functionality to easily generate and send queries to receive information about products and collections. It also has the ability to create checkouts.
accessToken | the access token used to query the Shopify Storefront API for a store |
domain | domain for the Shopify store |
|
inline |
It is possible to instantiate a ShopifyClient by passing an instance that implements BaseLoader . BaseLoaders handle network communication with the Storefront API. This functionality is useful if you'd like to use the Shopify SDK for Unity in a C# environment outside of Unity. The domain
string is inferred from BaseLoaders which can be used to request a specific client.
loader | a loader which will handle network communication with the Storefront API |
|
inline |
Creates a Cart , which can be used to manage line items for an order and create a web checkout link. One client can have multiple carts, so it's possible to pass in a cartId
to reference a specific cart. If no cartId
is passed, then a default Cart is used.
cartId | can be optionally passed in. This is useful if your application needs multiple carts |
|
inline |
Generates a query to fetch the specified collections
by id from a Shopify store. The generated query will query the following on collections:
callback | callback that will receive responses from server |
collectionIds | the list of collection ids you want to receive from the server |
|
inline |
Generates a query to receive selected collections
from a Shopify store. The generated query will query the following on collections:
callback | callback that will receive responses or errors from server |
firstCollectionId | you must pass in at least one collection id to query |
otherCollectionIds | after the first collection id you can pass in as many collection ids as you'd like. |
|
inline |
Generates a query to receive a page of collections
from a Shopify store. The generated query will query the following on collections:
Note that shop.collections
is a Connection (GraphQL paginated data structure). collections
callback | callback that will receive responses from server |
first | can be used to limit how many products are returned. For instance 10 would return only 10 collections |
after | is used to load subsequent pages. Basically it's a cursor variable to define what page to load next. For example, when used with first: 10 and after: "abc" , only the first 10 collections would be loaded after cursor "abc" . If no after is passed the first page of collections will be loaded. |
|
inline |
Allows you to build and send custom GraphQL mutation queries to the Storefront API.
buildQuery | delegate that will build a query starting at MutationQuery |
callback | callback which will receive a response |
|
inline |
Allows you to continuously make a root query, till the response is deemed ready.
isReady | A Delegates.PollUpdatedHandler that determines if polling should stop by returning true |
query | The query to be queried continuously |
|
inline |
Generates a query to receive selected products
from a Shopify store. The generated query will query the following on products:
callback | callback that will receive responses from server |
productIds | a list of product ids you'd like to query |
|
inline |
Generates a query to receive selected products
from a Shopify store. The generated query will query the following on products:
callback | callback that will receive responses or errors from server |
firstProductId | you must pass in at least one product id to query |
otherProductIds | after the first product id you can pass in as many product ids as you'd like. |
|
inline |
Generates a query to receive one page of products
from a Shopify store. The generated query will query the following on products:
Note that shop.products
is a Connection (GraphQL paginated data structure).
first
will define the page size. after
will be the cursor for the next page.
callback | callback that will receive responses from server. This callback also can receive ShopifyError or null if no error happened. The callback also receives after will be the cursor for the next page. If the callback's after parameter is null, there are no more pages to fetch. |
first | can be used to limit how many products are returned. For instance 10 would return only 10 products |
after | is used to load subsequent pages. Basically it's a cursor variable to define what page to load next. For example, when used with first: 10 and after: "abc" , only the first 10 products would be loaded after cursor "abc" . If no after is passed the first page of products will be loaded. |
|
inline |
Allows you to build and send custom GraphQL queries to the Storefront API. While having utility functions like products collections is useful, the Storefront API has more functionality. This method allows you to access all the extra functionality that the Storefront API provides.
buildQuery | delegate that will build a query starting at QueryRootQuery which will be sent to the Storefront API |
callback | callback which will receive a response |
|
inline |
Allows you to send custom GraphQL queries to the Storefront API. While having utility functions like products collections is useful, the Storefront API has more functionality. This method allows you to access all the extra functionality that the Storefront API provides.
query | a GraphQL query to be sent to the Storefront API |
callback | callback which will receive a response from the query |
|
inline |
Overwrites the QueryLoader instance with a new one with the specified locale.
locale | locale for fetching translated content of supported types and fields |
|
static |
This is a dictionary that defines aliases, maxWidth
, and maxHeight
for images loaded by products and collections . All Products images, Product variant images, and Collection images will be queried using aliases defined by this dictionary's keys and the maxWidth
and maxHeight
will be this dictionary's values.
|
get |
AccessToken is the access token associated with this client to query Shopify.
|
get |
|
get |
Locale is the language that supported translated content will be in.