Shopify Shop

This page documents the Shopify Shop model.

Data Shape

Gadget's database stores Shopify Shop records by storing and retrieving each of the fields defined on the model in the Gadget Editor to a managed database. Gadget has generated a GraphQL type matching the configured fields for Shopify Shop:

Shopify Shop Schema
1export interface ShopifyShop {
2 __typename: "ShopifyShop";
3
4 /** The globally unique, unchanging identifier for this record. Assigned and managed by Shopify. */
5 id: Scalars["GadgetID"];
6
7 /** The time at which this record was first created. Set once upon record creation and never changed. Managed by Gadget. */
8 createdAt: Scalars["DateTime"];
9
10 /** The time at which this record was last changed. Set each time the record is successfully acted upon by an action. Managed by Gadget. */
11 updatedAt: Scalars["DateTime"];
12
13 /** The current state this record is in. Changed by invoking actions. Managed by Gadget. */
14 state: Scalars["RecordState"];
15
16 address1: Scalars["String"] | null;
17
18 address2: Scalars["String"] | null;
19
20 checkoutApiSupported: Scalars["Boolean"] | null;
21
22 city: Scalars["String"] | null;
23
24 cookieConsentLevel: Scalars["String"] | null;
25
26 country: Scalars["String"] | null;
27
28 countryCode: Scalars["String"] | null;
29
30 countryName: Scalars["String"] | null;
31
32 countyTaxes: Scalars["JSON"] | null;
33
34 currency: Scalars["String"] | null;
35
36 customerEmail: Scalars["String"] | null;
37
38 domain: Scalars["String"] | null;
39
40 eligibleForCardReaderGiveaway: Scalars["Boolean"] | null;
41
42 eligibleForPayments: Scalars["Boolean"] | null;
43
44 email: Scalars["String"] | null;
45
46 enabledPresentmentCurrencies: Scalars["JSON"] | null;
47
48 finances: Scalars["Boolean"] | null;
49
50 forceSsl: Scalars["Boolean"] | null;
51
52 googleAppsDomain: Scalars["String"] | null;
53
54 googleAppsLoginEnabled: Scalars["Boolean"] | null;
55
56 hasDiscounts: Scalars["Boolean"] | null;
57
58 hasGiftCards: Scalars["Boolean"] | null;
59
60 hasStorefront: Scalars["Boolean"] | null;
61
62 ianaTimezone: Scalars["String"] | null;
63
64 latitude: Scalars["Float"] | null;
65
66 longitude: Scalars["Float"] | null;
67
68 moneyFormat: Scalars["String"] | null;
69
70 moneyInEmailsFormat: Scalars["String"] | null;
71
72 moneyWithCurrencyFormat: Scalars["String"] | null;
73
74 moneyWithCurrencyInEmailsFormat: Scalars["String"] | null;
75
76 multiLocationEnabled: Scalars["Boolean"] | null;
77
78 myshopifyDomain: Scalars["String"] | null;
79
80 name: Scalars["String"] | null;
81
82 passwordEnabled: Scalars["Boolean"] | null;
83
84 phone: Scalars["String"] | null;
85
86 planDisplayName: Scalars["String"] | null;
87
88 planName: Scalars["String"] | null;
89
90 preLaunchEnabled: Scalars["Boolean"] | null;
91
92 primaryLocale: Scalars["String"] | null;
93
94 province: Scalars["String"] | null;
95
96 provinceCode: Scalars["String"] | null;
97
98 requiresExtraPaymentsAgreement: Scalars["Boolean"] | null;
99
100 setupRequired: Scalars["Boolean"] | null;
101
102 shopifyCreatedAt: Scalars["DateTime"] | null;
103
104 shopOwner: Scalars["String"] | null;
105
106 source: Scalars["String"] | null;
107
108 taxShipping: Scalars["Boolean"] | null;
109
110 taxesIncluded: Scalars["Boolean"] | null;
111
112 shopifyUpdatedAt: Scalars["DateTime"] | null;
113
114 productImages: ShopifyProductImageConnection;
115
116 timezone: Scalars["String"] | null;
117
118 weightUnit: Scalars["String"] | null;
119
120 zipCode: Scalars["String"] | null;
121
122 productVariants: ShopifyProductVariantConnection;
123
124 syncs: ShopifySyncConnection;
125
126 products: ShopifyProductConnection;
127
128 accessToken: Scalars["String"] | null;
129
130 grantedScopes: Scalars["JSON"] | null;
131
132 installedViaApiKey: Scalars["String"] | null;
133
134 registeredWebhooks: Scalars["JSON"] | null;
135
136 /** Get all the fields for this record. Useful for not having to list out all the fields you want to retrieve, but slower. */
137 _all: Scalars["JSONObject"];
138}
1type ShopifyShop {
2 """
3 The globally unique, unchanging identifier for this record. Assigned and managed by Shopify.
4 """
5 id: GadgetID!
6
7 """
8 The time at which this record was first created. Set once upon record creation and never changed. Managed by Gadget.
9 """
10 createdAt: DateTime!
11
12 """
13 The time at which this record was last changed. Set each time the record is successfully acted upon by an action. Managed by Gadget.
14 """
15 updatedAt: DateTime!
16
17 """
18 The current state this record is in. Changed by invoking actions. Managed by Gadget.
19 """
20 state: RecordState!
21 address1: String
22 address2: String
23 checkoutApiSupported: Boolean
24 city: String
25 cookieConsentLevel: String
26 country: String
27 countryCode: String
28 countryName: String
29 countyTaxes: JSON
30 currency: String
31 customerEmail: String
32 domain: String
33 eligibleForCardReaderGiveaway: Boolean
34 eligibleForPayments: Boolean
35 email: String
36 enabledPresentmentCurrencies: JSON
37 finances: Boolean
38 forceSsl: Boolean
39 googleAppsDomain: String
40 googleAppsLoginEnabled: Boolean
41 hasDiscounts: Boolean
42 hasGiftCards: Boolean
43 hasStorefront: Boolean
44 ianaTimezone: String
45 latitude: Float
46 longitude: Float
47 moneyFormat: String
48 moneyInEmailsFormat: String
49 moneyWithCurrencyFormat: String
50 moneyWithCurrencyInEmailsFormat: String
51 multiLocationEnabled: Boolean
52 myshopifyDomain: String
53 name: String
54 passwordEnabled: Boolean
55 phone: String
56 planDisplayName: String
57 planName: String
58 preLaunchEnabled: Boolean
59 primaryLocale: String
60 province: String
61 provinceCode: String
62 requiresExtraPaymentsAgreement: Boolean
63 setupRequired: Boolean
64 shopifyCreatedAt: DateTime
65 shopOwner: String
66 source: String
67 taxShipping: Boolean
68 taxesIncluded: Boolean
69 shopifyUpdatedAt: DateTime
70 productImages(
71 """
72 Returns the items in the list that come after the specified cursor.
73 """
74 after: String
75
76 """
77 Returns the first n items from the list.
78 """
79 first: Int
80
81 """
82 Returns the items in the list that come before the specified cursor.
83 """
84 before: String
85
86 """
87 Returns the last n items from the list.
88 """
89 last: Int
90
91 """
92 A list of sort orders to return the results in
93 """
94 sort: [ShopifyProductImageSort!]
95
96 """
97 A list of filters to refine the results by
98 """
99 filter: [ShopifyProductImageFilter!]
100
101 """
102 A free form text search query to find records matching
103 """
104 search: String
105 ): ShopifyProductImageConnection!
106 timezone: String
107 weightUnit: String
108 zipCode: String
109 productVariants(
110 """
111 Returns the items in the list that come after the specified cursor.
112 """
113 after: String
114
115 """
116 Returns the first n items from the list.
117 """
118 first: Int
119
120 """
121 Returns the items in the list that come before the specified cursor.
122 """
123 before: String
124
125 """
126 Returns the last n items from the list.
127 """
128 last: Int
129
130 """
131 A list of sort orders to return the results in
132 """
133 sort: [ShopifyProductVariantSort!]
134
135 """
136 A list of filters to refine the results by
137 """
138 filter: [ShopifyProductVariantFilter!]
139
140 """
141 A free form text search query to find records matching
142 """
143 search: String
144 ): ShopifyProductVariantConnection!
145 syncs(
146 """
147 Returns the items in the list that come after the specified cursor.
148 """
149 after: String
150
151 """
152 Returns the first n items from the list.
153 """
154 first: Int
155
156 """
157 Returns the items in the list that come before the specified cursor.
158 """
159 before: String
160
161 """
162 Returns the last n items from the list.
163 """
164 last: Int
165
166 """
167 A list of sort orders to return the results in
168 """
169 sort: [ShopifySyncSort!]
170
171 """
172 A list of filters to refine the results by
173 """
174 filter: [ShopifySyncFilter!]
175
176 """
177 A free form text search query to find records matching
178 """
179 search: String
180 ): ShopifySyncConnection!
181 products(
182 """
183 Returns the items in the list that come after the specified cursor.
184 """
185 after: String
186
187 """
188 Returns the first n items from the list.
189 """
190 first: Int
191
192 """
193 Returns the items in the list that come before the specified cursor.
194 """
195 before: String
196
197 """
198 Returns the last n items from the list.
199 """
200 last: Int
201
202 """
203 A list of sort orders to return the results in
204 """
205 sort: [ShopifyProductSort!]
206
207 """
208 A list of filters to refine the results by
209 """
210 filter: [ShopifyProductFilter!]
211
212 """
213 A free form text search query to find records matching
214 """
215 search: String
216 ): ShopifyProductConnection!
217 accessToken: String
218 grantedScopes: JSON
219 installedViaApiKey: String
220 registeredWebhooks: JSON
221
222 """
223 Get all the fields for this record. Useful for not having to list out all the fields you want to retrieve, but slower.
224 """
225 _all: JSONObject!
226}

You can preview what a real record's shape looks like by fetching it using the alida-quiz-app-2 API Playground.

Any fetched Shopify Shop record will have this same ShopifyShop type, and expose the same data by default, regardless of if it's fetched by ID or as part of a findMany. This means you can select any of the record's fields wherever you like in a GraphQL query according to the use case at hand.

Retrieving one Shopify Shop record

Individual Shopify Shop records can be retrieved using the "find by ID" API endpoint. You can also return only some fields, or extra fields beyond what Gadget retrieves by default, using the select option.

The findOne function throws an error if no matching record is found, which you will need to catch and handle. Alternatively, you can use the maybeFindOne function, which returns null if no record is found, without throwing an error.

Similarly, the useFindOne React hook returns (but does not throw) an error when no matching record is found, while the useMaybeFindOne hook simply returns null if no record is found, without also returning an error.

Get one Shopify Shop
const shopifyShopRecord = await api.shopifyShop.findOne("some-id");
console.log(shopifyShopRecord.id); //=> a string
console.log(shopifyShopRecord.createdAt); //=> a Date object
const [result, refresh] = useFindOne(api.shopifyShop, "some-id");
const { data, error, fetching } = result;
console.log(data?.id); //=> a string
console.log(data?.createdAt); //=> a Date object
1query GetOneShopifyShop($id: GadgetID!) {
2 shopifyShop(id: $id) {
3 __typename
4 id
5 state
6 accessToken
7 address1
8 address2
9 checkoutApiSupported
10 city
11 cookieConsentLevel
12 country
13 countryCode
14 countryName
15 countyTaxes
16 createdAt
17 currency
18 customerEmail
19 domain
20 eligibleForCardReaderGiveaway
21 eligibleForPayments
22 email
23 enabledPresentmentCurrencies
24 finances
25 forceSsl
26 googleAppsDomain
27 googleAppsLoginEnabled
28 grantedScopes
29 hasDiscounts
30 hasGiftCards
31 hasStorefront
32 ianaTimezone
33 installedViaApiKey
34 latitude
35 longitude
36 moneyFormat
37 moneyInEmailsFormat
38 moneyWithCurrencyFormat
39 moneyWithCurrencyInEmailsFormat
40 multiLocationEnabled
41 myshopifyDomain
42 name
43 passwordEnabled
44 phone
45 planDisplayName
46 planName
47 preLaunchEnabled
48 primaryLocale
49 province
50 provinceCode
51 registeredWebhooks
52 requiresExtraPaymentsAgreement
53 setupRequired
54 shopOwner
55 shopifyCreatedAt
56 shopifyUpdatedAt
57 source
58 taxShipping
59 taxesIncluded
60 timezone
61 updatedAt
62 weightUnit
63 zipCode
64 }
65}
Variables
json
{ "id": "some-id" }

Retrieving the first of many Shopify Shop records

The first record from a list of records can be retrieved using the "find first" API endpoint. The source list of records can be filtered using the filter option, sorted using the sort option, searched using the search option, though no pagination options are available on this endpoint. You can also return only some fields, or extra fields beyond what Gadget retrieves by default using the select option.

The findFirst function throws an error if no matching record is found, which you will need to catch and handle. Alternatively, you can use the maybeFindFirst function, which returns null if no record is found, without throwing an error.

Similarly, the useFindFirst React hook returns (but does not throw) an error when no matching record is found, while the useMaybeFindFirst hook simply returns null if no record is found, without also returning an error.

Get one Shopify Shop
const shopifyShopRecord = await api.shopifyShop.findFirst();
console.log(shopifyShopRecord.id); //=> a string
console.log(shopifyShopRecord.createdAt); //=> a Date object
const [result, refresh] = useFindFirst(api.shopifyShop);
const { data, error, fetching } = result;
console.log(data?.id); //=> a string
console.log(data?.createdAt); //=> a Date object
1query FindManyShopifyShops(
2 $first: Int
3 $search: String
4 $sort: [ShopifyShopSort!]
5 $filter: [ShopifyShopFilter!]
6) {
7 shopifyShops(first: $first, search: $search, sort: $sort, filter: $filter) {
8 edges {
9 node {
10 __typename
11 id
12 state
13 accessToken
14 address1
15 address2
16 checkoutApiSupported
17 city
18 cookieConsentLevel
19 country
20 countryCode
21 countryName
22 countyTaxes
23 createdAt
24 currency
25 customerEmail
26 domain
27 eligibleForCardReaderGiveaway
28 eligibleForPayments
29 email
30 enabledPresentmentCurrencies
31 finances
32 forceSsl
33 googleAppsDomain
34 googleAppsLoginEnabled
35 grantedScopes
36 hasDiscounts
37 hasGiftCards
38 hasStorefront
39 ianaTimezone
40 installedViaApiKey
41 latitude
42 longitude
43 moneyFormat
44 moneyInEmailsFormat
45 moneyWithCurrencyFormat
46 moneyWithCurrencyInEmailsFormat
47 multiLocationEnabled
48 myshopifyDomain
49 name
50 passwordEnabled
51 phone
52 planDisplayName
53 planName
54 preLaunchEnabled
55 primaryLocale
56 province
57 provinceCode
58 registeredWebhooks
59 requiresExtraPaymentsAgreement
60 setupRequired
61 shopOwner
62 shopifyCreatedAt
63 shopifyUpdatedAt
64 source
65 taxShipping
66 taxesIncluded
67 timezone
68 updatedAt
69 weightUnit
70 zipCode
71 }
72 }
73 }
74}
Variables
json
{ "first": 1 }

Retrieving many Shopify Shop records

Pages of Shopify Shop records can be retrieved by using the "find many" API endpoint. The returned records can be filtered using the filter option, sorted using the sort option, searched using the search option, and paginated using standard Relay-style pagination options. You can also return only some fields, or extra fields beyond what Gadget retrieves by default using the select option.

This GraphQL endpoint returns records in the Relay Connection style (as a list of edges with nodes and cursors) so they can be paginated. The shopifyShops GraphQL endpoint works with any Relay-compatible caching client, or you can use Gadget's JS client for pagination with the findMany function.

Find a page of Shopify Shops

Fetch a page of records with the shopifyShop.findMany JS method or the shopifyShops GraphQL field. No options are required. The records returned will be implicitly sorted by ID ascending.

Find many Shopify Shops
const shopifyShopRecords = await api.shopifyShop.findMany();
console.log(shopifyShopRecords.length); //=> a number
console.log(shopifyShopRecords[0].id); //=> a string
const [result, refresh] = useFindMany(api.shopifyShop);
const { data, error, fetching } = result;
console.log(data?.length); //=> a number
console.log(data?.[0].length); //=> a string
1query FindManyShopifyShops {
2 shopifyShops {
3 edges {
4 node {
5 __typename
6 id
7 state
8 # ...
9 createdAt
10 updatedAt
11 }
12 }
13 }
14}
Variables
json
{}

Sorting

Records can be sorted in the database to retrieve them in a certain order. Records are always implicitly sorted by ID ascending unless an explicit sort on the id field is defined. The GraphQL type ShopifyShopSort defines which fields can be sorted by.

Records can be sorted by multiple different fields and in multiple different directions by passing a list of ShopifyShopSort instead of just one.

GraphQL
1input ShopifyShopSort {
2 id: SortOrder
3 createdAt: SortOrder
4 updatedAt: SortOrder
5 state: SortOrder
6 address1: SortOrder
7 address2: SortOrder
8 checkoutApiSupported: SortOrder
9 city: SortOrder
10 cookieConsentLevel: SortOrder
11 country: SortOrder
12 countryCode: SortOrder
13 countryName: SortOrder
14 countyTaxes: SortOrder
15 currency: SortOrder
16 customerEmail: SortOrder
17 domain: SortOrder
18 eligibleForCardReaderGiveaway: SortOrder
19 eligibleForPayments: SortOrder
20 email: SortOrder
21 enabledPresentmentCurrencies: SortOrder
22 finances: SortOrder
23 forceSsl: SortOrder
24 googleAppsDomain: SortOrder
25 googleAppsLoginEnabled: SortOrder
26 hasDiscounts: SortOrder
27 hasGiftCards: SortOrder
28 hasStorefront: SortOrder
29 ianaTimezone: SortOrder
30 latitude: SortOrder
31 longitude: SortOrder
32 moneyFormat: SortOrder
33 moneyInEmailsFormat: SortOrder
34 moneyWithCurrencyFormat: SortOrder
35 moneyWithCurrencyInEmailsFormat: SortOrder
36 multiLocationEnabled: SortOrder
37 myshopifyDomain: SortOrder
38 name: SortOrder
39 passwordEnabled: SortOrder
40 phone: SortOrder
41 planDisplayName: SortOrder
42 planName: SortOrder
43 preLaunchEnabled: SortOrder
44 primaryLocale: SortOrder
45 province: SortOrder
46 provinceCode: SortOrder
47 requiresExtraPaymentsAgreement: SortOrder
48 setupRequired: SortOrder
49 shopifyCreatedAt: SortOrder
50 shopOwner: SortOrder
51 source: SortOrder
52 taxShipping: SortOrder
53 taxesIncluded: SortOrder
54 shopifyUpdatedAt: SortOrder
55 timezone: SortOrder
56 weightUnit: SortOrder
57 zipCode: SortOrder
58 accessToken: SortOrder
59 grantedScopes: SortOrder
60 installedViaApiKey: SortOrder
61 registeredWebhooks: SortOrder
62}

Pass the sort option to the JS client, or the sort variable to a GraphQL query to sort the records returned.

Sort Shopify Shop by most recently created
const shopifyShopRecords = await api.shopifyShop.findMany({
sort: { createdAt: "Descending" },
});
const [result, refresh] = useFindMany(api.shopifyShop, {
sort: { createdAt: "Descending" },
});
const { data, error, fetching } = result;
1query FindManyShopifyShops($sort: [ShopifyShopSort!]) {
2 shopifyShops(sort: $sort) {
3 edges {
4 node {
5 __typename
6 id
7 state
8 # ...
9 createdAt
10 updatedAt
11 }
12 }
13 }
14}
Variables
json
{ "sort": { "createdAt": "Descending" } }

Sort by multiple fields by passing an array of { [field]: "Ascending" | "Descending" } objects.

Sort Shopify Shop by multiple fields
const shopifyShopRecords = await api.shopifyShop.findMany({
sort: [{ state: "Descending" }, { createdAt: "Ascending" }],
});
const [result, refresh] = useFindMany(api.shopifyShop, {
sort: [{ state: "Descending" }, { createdAt: "Ascending" }],
});
const { data, error, fetching } = result;
1query FindManyShopifyShops($sort: [ShopifyShopSort!]) {
2 shopifyShops(sort: $sort) {
3 edges {
4 node {
5 __typename
6 id
7 state
8 # ...
9 createdAt
10 updatedAt
11 }
12 }
13 }
14}
Variables
json
{ "sort": [{ "state": "Descending" }, { "createdAt": "Ascending" }] }

All primitive field types in Gadget are sortable so you are able to sort by fields you have added to a model as well.

Sort Shopify Shops by ID descending
const shopifyShopRecords = await api.shopifyShop.findMany({
sort: { id: "Descending" },
});
const [result, refresh] = useFindMany(api.shopifyShop, {
sort: { id: "Descending" },
});
const { data, error, fetching } = result;
1query FindManyShopifyShops($sort: [ShopifyShopSort!]) {
2 shopifyShops(sort: $sort) {
3 edges {
4 node {
5 __typename
6 id
7 state
8 # ...
9 createdAt
10 updatedAt
11 }
12 }
13 }
14}
Variables
json
{ "sort": { "id": "Descending" } }

Searching

Shopify Shop records can be searched using Gadget's built in full text search functionality. Gadget search is appropriate for powering autocompletes, searchable tables, or other experiences where humans are writing search queries. It's typo tolerant, synonym aware and supports simple search operators like ! to exclude search terms.

Search Shopify Shops by passing the search parameter with a search query string.

Search isn't field specific in Gadget -- all String or RichText field types are searched with the built in search functionality.

Full text search Shopify Shops
const shopifyShopRecords = await api.shopifyShop.findMany({
search: "a specific phrase to search for",
});
const [result, refresh] = useFindMany(api.shopifyShop, {
search: "a specific phrase to search for",
});
const { data, error, fetching } = result;
1query FindManyShopifyShops($search: String) {
2 shopifyShops(search: $search) {
3 edges {
4 node {
5 __typename
6 id
7 state
8 # ...
9 createdAt
10 updatedAt
11 }
12 }
13 }
14}
Variables
json
{ "search": "a specific phrase to search for" }

Filtering

Shopify Shop records can be filtered to return only the appropriate records. Records can be filtered on any field, including those managed by Gadget or fields added by developers. Filters can be combined with sorts, searches and paginated using cursor-based Relay pagination.

Filter Shopify Shops by passing the filter parameter with a filter object. Filter objects are nestable boolean conditions expressed as JS objects capturing a key, an operator, and usually a value.

The GraphQL type ShopifyShopFilter defines which fields can be filtered on.

Records can be filtered by multiple different fields. If you want to combine filters using boolean logic, nest them under the AND, OR, or NOT keys of a parent filter. Filters can be nested deeply by passing multiple levels boolean condition filters.

You can also pass a list of filters to the filter parameter which will be implicitly ANDed with one another such that they all need to match for a record to be returned.

Available filters
GraphQL
1input ShopifyShopFilter {
2 AND: [ShopifyShopFilter]
3 OR: [ShopifyShopFilter]
4 NOT: [ShopifyShopFilter]
5 id: IDFilter
6 createdAt: DateTimeFilter
7 updatedAt: DateTimeFilter
8 state: StateFilter
9 address1: StringFilter
10 address2: StringFilter
11 checkoutApiSupported: BooleanFilter
12 city: StringFilter
13 cookieConsentLevel: StringFilter
14 country: StringFilter
15 countryCode: StringFilter
16 countryName: StringFilter
17 countyTaxes: AnyFilter
18 currency: StringFilter
19 customerEmail: StringFilter
20 domain: StringFilter
21 eligibleForCardReaderGiveaway: BooleanFilter
22 eligibleForPayments: BooleanFilter
23 email: StringFilter
24 enabledPresentmentCurrencies: AnyFilter
25 finances: BooleanFilter
26 forceSsl: BooleanFilter
27 googleAppsDomain: StringFilter
28 googleAppsLoginEnabled: BooleanFilter
29 hasDiscounts: BooleanFilter
30 hasGiftCards: BooleanFilter
31 hasStorefront: BooleanFilter
32 ianaTimezone: StringFilter
33 latitude: FloatFilter
34 longitude: FloatFilter
35 moneyFormat: StringFilter
36 moneyInEmailsFormat: StringFilter
37 moneyWithCurrencyFormat: StringFilter
38 moneyWithCurrencyInEmailsFormat: StringFilter
39 multiLocationEnabled: BooleanFilter
40 myshopifyDomain: StringFilter
41 name: StringFilter
42 passwordEnabled: BooleanFilter
43 phone: StringFilter
44 planDisplayName: StringFilter
45 planName: StringFilter
46 preLaunchEnabled: BooleanFilter
47 primaryLocale: StringFilter
48 province: StringFilter
49 provinceCode: StringFilter
50 requiresExtraPaymentsAgreement: BooleanFilter
51 setupRequired: BooleanFilter
52 shopifyCreatedAt: DateTimeFilter
53 shopOwner: StringFilter
54 source: StringFilter
55 taxShipping: BooleanFilter
56 taxesIncluded: BooleanFilter
57 shopifyUpdatedAt: DateTimeFilter
58 timezone: StringFilter
59 weightUnit: StringFilter
60 zipCode: StringFilter
61 accessToken: StringFilter
62 grantedScopes: AnyFilter
63 installedViaApiKey: StringFilter
64 registeredWebhooks: JSONFilter
65}
Find Shopify Shops created in the last day
const yesterday = new Date(Date.now() - 864e5);
const shopifyShopRecords = await api.shopifyShop.findMany({
filter: { createdAt: { greaterThan: yesterday } },
});
const yesterday = new Date(Date.now() - 864e5);
const [result, refresh] = useFindMany(api.shopifyShop, {
filter: { createdAt: { greaterThan: yesterday } },
});
const { data, error, fetching } = result;
1query FindManyShopifyShops($filter: [ShopifyShopFilter!]) {
2 shopifyShops(filter: $filter) {
3 edges {
4 node {
5 __typename
6 id
7 state
8 # ...
9 createdAt
10 updatedAt
11 }
12 }
13 }
14}
Variables
json
{ "filter": { "createdAt": { "greaterThan": "2022-12-08T08:50:29.181Z" } } }
Shopify Shops created this week or updated today
1const yesterday = new Date(Date.now() - 86400000);
2const oneWeekAgo = new Date(Date.now() - 604800000);
3const shopifyShopRecords = await api.shopifyShop.findMany({
4 filter: {
5 OR: [
6 {
7 createdAt: { greaterThan: oneWeekAgo },
8 },
9 {
10 updated: { greaterThan: yesterday },
11 },
12 ],
13 },
14});
1const yesterday = new Date(Date.now() - 86400000);
2const oneWeekAgo = new Date(Date.now() - 604800000);
3const [result, refresh] = useFindMany(api.shopifyShop, {
4 filter: {
5 OR: [
6 {
7 createdAt: { greaterThan: oneWeekAgo },
8 },
9 {
10 updated: { greaterThan: yesterday },
11 },
12 ],
13 },
14});
15const { data, error, fetching } = result;
1query FindManyShopifyShops($filter: [ShopifyShopFilter!]) {
2 shopifyShops(filter: $filter) {
3 edges {
4 node {
5 __typename
6 id
7 state
8 # ...
9 createdAt
10 updatedAt
11 }
12 }
13 }
14}
Variables
json
1{
2 "filter": {
3 "OR": [
4 { "createdAt": { "greaterThan": "2022-12-02T08:50:29.181Z" } },
5 { "updated": { "greaterThan": "2022-12-08T08:50:29.181Z" } }
6 ]
7 }
8}
Filter records that are in the installed state
const shopifyShopRecords = await api.shopifyShop.findMany({
filter: {
state: { inState: "created.installed" },
},
});
1const [result, refresh] = useFindMany(api.shopifyShop, {
2 filter: {
3 state: { inState: "created.installed" },
4 },
5});
6const { data, error, fetching } = result;
1query FindManyShopifyShops($filter: [ShopifyShopFilter!]) {
2 shopifyShops(filter: $filter) {
3 edges {
4 node {
5 __typename
6 id
7 state
8 # ...
9 createdAt
10 updatedAt
11 }
12 }
13 }
14}
Variables
json
{ "filter": { "state": { "inState": "created.installed" } } }

Most field types in Gadget are filterable, so you are able to filter by fields you have added to a model as well.

const shopifyShopRecords = await api.shopifyShop.findMany({
filter: {
id: { isSet: true },
},
});
1const [result, refresh] = useFindMany(api.shopifyShop, {
2 filter: {
3 id: { isSet: true },
4 },
5});
6const { data, error, fetching } = result;
1query FindManyShopifyShops($filter: [ShopifyShopFilter!]) {
2 shopifyShops(filter: $filter) {
3 edges {
4 node {
5 __typename
6 id
7 state
8 # ...
9 createdAt
10 updatedAt
11 }
12 }
13 }
14}
Variables
json
{ "filter": { "id": { "isSet": true } } }

Pagination

All Gadget record lists, including the top level Shopify Shop finder as well as associations to Shopify Shop, are structured as GraphQL connections. GraphQL connections are the defacto standard for querying lists and support cursor based forward and backward pagination. When querying via GraphQL, you must select the edges field and then the node field to get the Shopify Shop record. When querying using a Gadget API client, the GraphQL queries are generated for you and the records are unwrapped and returned as a GadgetRecordList ready for use.

Shopify Shop pagination supports the standard GraphQL connection pagination arguments: first + after, or last + before. Pagination is done using cursors, which you can retrieve from the edge.cursor field or the pageInfo.startCursor properties.

Get the first page of 25 Shopify Shops
const shopifyShopRecords = await api.shopifyShop.findMany({ first: 25 });
console.log(shopifyShopRecords.length); //=> no greater than 25
const [result, refresh] = useFindMany(api.shopifyShop, { first: 25 });
const { data, error, fetching } = result;
console.log(data?.length); //=> no greater than 25
1query FindManyShopifyShops($first: Int, $after: String) {
2 shopifyShops(first: $first, after: $after) {
3 edges {
4 cursor
5 node {
6 __typename
7 id
8 state
9 # ...
10 createdAt
11 updatedAt
12 }
13 }
14 pageInfo {
15 endCursor
16 hasNextPage
17 hasPreviousPage
18 startCursor
19 }
20 }
21}
Variables
json
{ "first": 25 }

The after cursor used in this example data won't return any records if used in a real API request.

Next 25 Shopify Shop records after cursor
const shopifyShopRecords = await api.shopifyShop.findMany({
after: "abcdefg",
first: 25,
});
const [result, refresh] = useFindMany(api.shopifyShop, {
after: "abcdefg",
first: 25,
});
const { data, error, fetching } = result;
1query FindManyShopifyShops($first: Int, $after: String) {
2 shopifyShops(first: $first, after: $after) {
3 edges {
4 cursor
5 node {
6 __typename
7 id
8 state
9 # ...
10 createdAt
11 updatedAt
12 }
13 }
14 pageInfo {
15 endCursor
16 hasNextPage
17 hasPreviousPage
18 startCursor
19 }
20 }
21}
Variables
json
{ "first": 25, "after": "abcdefg" }

Pagination Limits

Root level record finders like shopifyShops support a maximum page size of 250 records, and a default page size of 50 records. The page size is controlled using the first or last GraphQL field arguments.

Related record finders that access lists of records through a has many or has many field support a maximum page size of 100 records, and a default page size of 50 records.

Get the next or previous page

When using the generated JavaScript API client, the record lists returned from find many calls can be paginated using the nextPage() or previousPage() option.

Both nextPage() and previousPage() will throw an error if the corresponding hasNextPage or hasPreviousPage is false.

JavaScript
1const shopifyShopRecords = await api.shopifyShop.findMany();
2if (shopifyShopRecords.hasNextPage) {
3 const nextPage = await shopifyShopRecords.nextPage();
4}
5if (shopifyShopRecords.hasPreviousPage) {
6 const prevPage = await shopifyShopRecords.previousPage();
7}

Selecting fields, and fields of fields

When using the JavaScript client, all of findOne, maybeFindOne, findMany, findFirst, maybeFindFirst, and various action functions, allow requesting specific fields of a Shopify Shop and its relationships. The select option controls which fields are selected in the generated GraphQL query sent to the Gadget API. Pass each field you want to select in an object, with true as the value for scalar fields, and a nested object of the same shape for nested fields.

Gadget has a default selection that will retrieve all of the scalar fields for a Shopify Shop. If you don't pass a select option to a record finder, this default selection will be used.

Select only some Shopify Shop fields
1// fetch only the id, state, and createdAt field
2const shopifyShopRecords = await api.shopifyShop.findMany({
3 select: { id: true, state: true, createdAt: true },
4});
5// fetch all the scalar fields for the model, but no relationship fields
6const shopifyShopRecords = await api.shopifyShop.findMany();
1// fetch only the id, state, and createdAt field
2const [result, refresh] = useFindMany(api.shopifyShop, {
3 select: { id: true, state: true, createdAt: true },
4});
5const { data, error, fetching } = result;
6// fetch all the scalar fields for the model, but no relationship fields
7const [result, refresh] = useFindMany(api.shopifyShop);
8const { data, error, fetching } = result;
Type Safety

The select option is fully type safe if you're using TypeScript. The returned GadgetRecord type will have a <Shape> exactly matching the fields and nested fields you selected. For more information, see Type Safety .

This behavior of selecting only some fields is built right into GraphQL. If you want to limit or expand what you retrieve from a GraphQL query, include or exclude those fields in your GraphQL query. For more information on executing GraphQL queries, see GraphQL.

Select nested Shopify Shop fields
1// fetch the id, state, and createdAt field, and fetch some nested fields from an example relationship field named `someRelatedObject`
2const shopifyShopRecords = await api.shopifyShop.findMany({
3 select: {
4 id: true,
5 state: true,
6 createdAt: true,
7 someRelatedObject: { id: true, createdAt: true },
8 },
9});
1// fetch the id, state, and createdAt field, and fetch some nested fields from an example relationship field named `someRelatedObject`
2const [result, refresh] = useFindMany(api.shopifyShop, {
3 select: {
4 id: true,
5 state: true,
6 createdAt: true,
7 someRelatedObject: { id: true, createdAt: true },
8 },
9});
10const { data, error, fetching } = result;

Combining parameters

Sort, search, filtering, selection, and pagination parameters can be combined to access the exact set of records needed for your use case.

Combining Parameters
1const shopifyShopRecords = await api.shopifyShop.findMany({
2 search: "<some search query>",
3 sort: { createdAt: "Descending" },
4 filter: { updatedAt: { greaterThan: new Date(Date.now() - 864e5) } },
5 select: { id: true, createdAt: true },
6 first: 25,
7 after: "abcdefg",
8});
1const [result, refresh] = useFindMany(api.shopifyShop, {
2 search: "<some search query>",
3 sort: { createdAt: "Descending" },
4 filter: { updatedAt: { greaterThan: new Date(Date.now() - 864e5) } },
5 select: { id: true, createdAt: true },
6 first: 25,
7 after: "abcdefg",
8});
9const { data, error, fetching } = result;
1query FindManyShopifyShops(
2 $after: String
3 $before: String
4 $first: Int
5 $last: Int
6 $search: String
7 $sort: [ShopifyShopSort!]
8 $filter: [ShopifyShopFilter!]
9) {
10 shopifyShops(
11 after: $after
12 before: $before
13 first: $first
14 last: $last
15 search: $search
16 sort: $sort
17 filter: $filter
18 ) {
19 edges {
20 cursor
21 node {
22 __typename
23 id
24 state
25 accessToken
26 address1
27 address2
28 checkoutApiSupported
29 city
30 cookieConsentLevel
31 country
32 countryCode
33 countryName
34 countyTaxes
35 createdAt
36 currency
37 customerEmail
38 domain
39 eligibleForCardReaderGiveaway
40 eligibleForPayments
41 email
42 enabledPresentmentCurrencies
43 finances
44 forceSsl
45 googleAppsDomain
46 googleAppsLoginEnabled
47 grantedScopes
48 hasDiscounts
49 hasGiftCards
50 hasStorefront
51 ianaTimezone
52 installedViaApiKey
53 latitude
54 longitude
55 moneyFormat
56 moneyInEmailsFormat
57 moneyWithCurrencyFormat
58 moneyWithCurrencyInEmailsFormat
59 multiLocationEnabled
60 myshopifyDomain
61 name
62 passwordEnabled
63 phone
64 planDisplayName
65 planName
66 preLaunchEnabled
67 primaryLocale
68 province
69 provinceCode
70 registeredWebhooks
71 requiresExtraPaymentsAgreement
72 setupRequired
73 shopOwner
74 shopifyCreatedAt
75 shopifyUpdatedAt
76 source
77 taxShipping
78 taxesIncluded
79 timezone
80 updatedAt
81 weightUnit
82 zipCode
83 }
84 }
85 pageInfo {
86 endCursor
87 hasNextPage
88 hasPreviousPage
89 startCursor
90 }
91 }
92}
Variables
json
1{
2 "search": "<some search query>",
3 "sort": { "createdAt": "Descending" },
4 "filter": { "updatedAt": { "greaterThan": "2022-12-08T08:50:29.386Z" } },
5 "first": 25,
6 "after": "abcdefg"
7}

Invoking Actions

Shopify Shop records are changed by invoking Actions. Actions are the things that "do" stuff -- update records, make API calls, call backend code, etc. Actions each have one corresponding GraphQL mutation and a corresponding function available in the API client libraries. Nested Actions can also be invoked with the API client, by providing the actions as input to any relationship fields.

Action Result format

Each API action returns results in the same format that includes a success indicator, errors, and the actual result if the action succeeded. The result is the record that was acted on for a model action, or a list of records for a bulk action, or a JSON blob for Global Actions. Model actions that delete the record don't return the record.

The success field returns a boolean indicating if the action executed as expected. Any execution errors are returned in the errors object, which will always be null if success is true or contain ExecutionError objects if success is false.

ExecutionError objects always have a message describing what error prevented the action from succeeding, as well as a code attribute that gives a stable, searchable, human readable error class code for referencing this specific error. Details on each error code can be found in the Errors documentation. All ExecutionError object types returned by the GraphQL object can be one of many types of error, where some types have extra data that is useful for remedying the error. All error types will always have message and code properties, but some, like InvalidRecordError have extra fields for use by clients.

Errors when using the generated client

The generated JavaScript client automatically interprets errors from invoking actions and throws JavaScript Error instances if the action didn't succeed. The Error objects it throws are rich, and expose extra error properties beyond just message and code if they exist.

Errors thrown by the JavaScript client are easiest to catch by using a try/catch statement around an await, like so:

JavaScript
1import {
2 GadgetOperationError,
3 InvalidRecordError,
4} from "@gadget-client/example-app";
5
6// must be in an async function to use `await` syntax
7const runAction = async () => {
8 try {
9 return await api.exampleModel.create({
10 exampleModel: { name: "example record name" },
11 });
12 } catch (error) {
13 if (error instanceof GadgetOperationError) {
14 // a recognized general error has occurred, retry the operation or inspect error.code`
15 console.error(error);
16 } else if (error instanceof InvalidRecordError) {
17 // the submitted input data for the action was invalid, inspect the invalid fields which `InvalidRecordError` exposes
18 console.error(error.validationErrors);
19 } else {
20 // an unrecognized error occurred, like an HTTP connection interrupted error or a syntax error. Re-throw it because it's not clear what to do to fix ti
21 throw error;
22 }
23 }
24};

For more information on error codes, consult the Errors documentation.

Shopify Shop create

Input

create accepts the following input parameters:

create Input Data
1export interface CreateShopifyShopInput {
2 id?: (Scalars["GadgetID"] | null) | null;
3
4 address1?: (Scalars["String"] | null) | null;
5
6 address2?: (Scalars["String"] | null) | null;
7
8 checkoutApiSupported?: (Scalars["Boolean"] | null) | null;
9
10 city?: (Scalars["String"] | null) | null;
11
12 cookieConsentLevel?: (Scalars["String"] | null) | null;
13
14 country?: (Scalars["String"] | null) | null;
15
16 countryCode?: (Scalars["String"] | null) | null;
17
18 countryName?: (Scalars["String"] | null) | null;
19
20 countyTaxes?: (Scalars["JSON"] | null) | null;
21
22 currency?: (Scalars["String"] | null) | null;
23
24 customerEmail?: (Scalars["String"] | null) | null;
25
26 domain?: (Scalars["String"] | null) | null;
27
28 eligibleForCardReaderGiveaway?: (Scalars["Boolean"] | null) | null;
29
30 eligibleForPayments?: (Scalars["Boolean"] | null) | null;
31
32 email?: (Scalars["String"] | null) | null;
33
34 enabledPresentmentCurrencies?: (Scalars["JSON"] | null) | null;
35
36 finances?: (Scalars["Boolean"] | null) | null;
37
38 forceSsl?: (Scalars["Boolean"] | null) | null;
39
40 googleAppsDomain?: (Scalars["String"] | null) | null;
41
42 googleAppsLoginEnabled?: (Scalars["Boolean"] | null) | null;
43
44 hasDiscounts?: (Scalars["Boolean"] | null) | null;
45
46 hasGiftCards?: (Scalars["Boolean"] | null) | null;
47
48 hasStorefront?: (Scalars["Boolean"] | null) | null;
49
50 ianaTimezone?: (Scalars["String"] | null) | null;
51
52 latitude?: (Scalars["Float"] | null) | null;
53
54 longitude?: (Scalars["Float"] | null) | null;
55
56 moneyFormat?: (Scalars["String"] | null) | null;
57
58 moneyInEmailsFormat?: (Scalars["String"] | null) | null;
59
60 moneyWithCurrencyFormat?: (Scalars["String"] | null) | null;
61
62 moneyWithCurrencyInEmailsFormat?: (Scalars["String"] | null) | null;
63
64 multiLocationEnabled?: (Scalars["Boolean"] | null) | null;
65
66 myshopifyDomain?: (Scalars["String"] | null) | null;
67
68 name?: (Scalars["String"] | null) | null;
69
70 passwordEnabled?: (Scalars["Boolean"] | null) | null;
71
72 phone?: (Scalars["String"] | null) | null;
73
74 planDisplayName?: (Scalars["String"] | null) | null;
75
76 planName?: (Scalars["String"] | null) | null;
77
78 preLaunchEnabled?: (Scalars["Boolean"] | null) | null;
79
80 primaryLocale?: (Scalars["String"] | null) | null;
81
82 province?: (Scalars["String"] | null) | null;
83
84 provinceCode?: (Scalars["String"] | null) | null;
85
86 requiresExtraPaymentsAgreement?: (Scalars["Boolean"] | null) | null;
87
88 setupRequired?: (Scalars["Boolean"] | null) | null;
89
90 shopifyCreatedAt?: Date | Scalars["ISO8601DateString"] | null;
91
92 shopOwner?: (Scalars["String"] | null) | null;
93
94 source?: (Scalars["String"] | null) | null;
95
96 taxShipping?: (Scalars["Boolean"] | null) | null;
97
98 taxesIncluded?: (Scalars["Boolean"] | null) | null;
99
100 shopifyUpdatedAt?: Date | Scalars["ISO8601DateString"] | null;
101
102 productImages?: (ShopifyProductImageHasManyInput | null)[];
103
104 timezone?: (Scalars["String"] | null) | null;
105
106 weightUnit?: (Scalars["String"] | null) | null;
107
108 zipCode?: (Scalars["String"] | null) | null;
109
110 productVariants?: (ShopifyProductVariantHasManyInput | null)[];
111
112 syncs?: (ShopifySyncHasManyInput | null)[];
113
114 products?: (ShopifyProductHasManyInput | null)[];
115}
116
117export interface CreateShopifyShopArguments {
118 shopifyShop?: CreateShopifyShopInput | null;
119}
1input CreateShopifyShopInput {
2 id: GadgetID
3 address1: String
4 address2: String
5 checkoutApiSupported: Boolean
6 city: String
7 cookieConsentLevel: String
8 country: String
9 countryCode: String
10 countryName: String
11 countyTaxes: JSON
12 currency: String
13 customerEmail: String
14 domain: String
15 eligibleForCardReaderGiveaway: Boolean
16 eligibleForPayments: Boolean
17 email: String
18 enabledPresentmentCurrencies: JSON
19 finances: Boolean
20 forceSsl: Boolean
21 googleAppsDomain: String
22 googleAppsLoginEnabled: Boolean
23 hasDiscounts: Boolean
24 hasGiftCards: Boolean
25 hasStorefront: Boolean
26 ianaTimezone: String
27 latitude: Float
28 longitude: Float
29 moneyFormat: String
30 moneyInEmailsFormat: String
31 moneyWithCurrencyFormat: String
32 moneyWithCurrencyInEmailsFormat: String
33 multiLocationEnabled: Boolean
34 myshopifyDomain: String
35 name: String
36 passwordEnabled: Boolean
37 phone: String
38 planDisplayName: String
39 planName: String
40 preLaunchEnabled: Boolean
41 primaryLocale: String
42 province: String
43 provinceCode: String
44 requiresExtraPaymentsAgreement: Boolean
45 setupRequired: Boolean
46 shopifyCreatedAt: DateTime
47 shopOwner: String
48 source: String
49 taxShipping: Boolean
50 taxesIncluded: Boolean
51 shopifyUpdatedAt: DateTime
52 productImages: [ShopifyProductImageHasManyInput]
53 timezone: String
54 weightUnit: String
55 zipCode: String
56 productVariants: [ShopifyProductVariantHasManyInput]
57 syncs: [ShopifySyncHasManyInput]
58 products: [ShopifyProductHasManyInput]
59}
60
61input CreateShopifyShopArguments {
62 shopifyShop: CreateShopifyShopInput
63}
Example create Invocation
1const shopifyShopRecord = await api.shopifyShop.create({
2 shopifyShop: {
3 // field values for Shopify Shop
4 },
5});
6console.log(shopifyShopRecord.id); //=> a string
1const [result, createShopifyShop] = useAction(api.shopifyShop.create);
2const { data, error, fetching } = result;
3await createShopifyShop({
4 shopifyShop: {
5 // field values for Shopify Shop
6 },
7});
8console.log(data?.id); //=> a string
1mutation ($shopifyShop: CreateShopifyShopInput) {
2 createShopifyShop(shopifyShop: $shopifyShop) {
3 success
4 errors {
5 message
6 ... on InvalidRecordError {
7 validationErrors {
8 apiIdentifier
9 message
10 }
11 record
12 model {
13 apiIdentifier
14 }
15 }
16 }
17 shopifyShop {
18 __typename
19 id
20 state
21 accessToken
22 address1
23 address2
24 checkoutApiSupported
25 city
26 cookieConsentLevel
27 country
28 countryCode
29 countryName
30 countyTaxes
31 createdAt
32 currency
33 customerEmail
34 domain
35 eligibleForCardReaderGiveaway
36 eligibleForPayments
37 email
38 enabledPresentmentCurrencies
39 finances
40 forceSsl
41 googleAppsDomain
42 googleAppsLoginEnabled
43 grantedScopes
44 hasDiscounts
45 hasGiftCards
46 hasStorefront
47 ianaTimezone
48 installedViaApiKey
49 latitude
50 longitude
51 moneyFormat
52 moneyInEmailsFormat
53 moneyWithCurrencyFormat
54 moneyWithCurrencyInEmailsFormat
55 multiLocationEnabled
56 myshopifyDomain
57 name
58 passwordEnabled
59 phone
60 planDisplayName
61 planName
62 preLaunchEnabled
63 primaryLocale
64 province
65 provinceCode
66 registeredWebhooks
67 requiresExtraPaymentsAgreement
68 setupRequired
69 shopOwner
70 shopifyCreatedAt
71 shopifyUpdatedAt
72 source
73 taxShipping
74 taxesIncluded
75 timezone
76 updatedAt
77 weightUnit
78 zipCode
79 }
80 }
81}
Variables
json
{ "shopifyShop": {} }
Output

create returns the Shopify Shop. In the JS client, the fields returned can be controlled with the select option. In GraphQL, the return format is the action result format, which includes the record if the action was successful. You can include or exclude the fields you need right in the mutation itself.

create Output Data
type CreateShopifyShopResult {
success: Boolean!
errors: [ExecutionError!]
shopifyShop: ShopifyShop
}

Shopify Shop update

Input

update operates on one Shopify Shop in particular, identified by the id variable.update accepts the following input parameters:

update Input Data
1export interface UpdateShopifyShopInput {
2 id?: (Scalars["GadgetID"] | null) | null;
3
4 address1?: (Scalars["String"] | null) | null;
5
6 address2?: (Scalars["String"] | null) | null;
7
8 checkoutApiSupported?: (Scalars["Boolean"] | null) | null;
9
10 city?: (Scalars["String"] | null) | null;
11
12 cookieConsentLevel?: (Scalars["String"] | null) | null;
13
14 country?: (Scalars["String"] | null) | null;
15
16 countryCode?: (Scalars["String"] | null) | null;
17
18 countryName?: (Scalars["String"] | null) | null;
19
20 countyTaxes?: (Scalars["JSON"] | null) | null;
21
22 currency?: (Scalars["String"] | null) | null;
23
24 customerEmail?: (Scalars["String"] | null) | null;
25
26 domain?: (Scalars["String"] | null) | null;
27
28 eligibleForCardReaderGiveaway?: (Scalars["Boolean"] | null) | null;
29
30 eligibleForPayments?: (Scalars["Boolean"] | null) | null;
31
32 email?: (Scalars["String"] | null) | null;
33
34 enabledPresentmentCurrencies?: (Scalars["JSON"] | null) | null;
35
36 finances?: (Scalars["Boolean"] | null) | null;
37
38 forceSsl?: (Scalars["Boolean"] | null) | null;
39
40 googleAppsDomain?: (Scalars["String"] | null) | null;
41
42 googleAppsLoginEnabled?: (Scalars["Boolean"] | null) | null;
43
44 hasDiscounts?: (Scalars["Boolean"] | null) | null;
45
46 hasGiftCards?: (Scalars["Boolean"] | null) | null;
47
48 hasStorefront?: (Scalars["Boolean"] | null) | null;
49
50 ianaTimezone?: (Scalars["String"] | null) | null;
51
52 latitude?: (Scalars["Float"] | null) | null;
53
54 longitude?: (Scalars["Float"] | null) | null;
55
56 moneyFormat?: (Scalars["String"] | null) | null;
57
58 moneyInEmailsFormat?: (Scalars["String"] | null) | null;
59
60 moneyWithCurrencyFormat?: (Scalars["String"] | null) | null;
61
62 moneyWithCurrencyInEmailsFormat?: (Scalars["String"] | null) | null;
63
64 multiLocationEnabled?: (Scalars["Boolean"] | null) | null;
65
66 myshopifyDomain?: (Scalars["String"] | null) | null;
67
68 name?: (Scalars["String"] | null) | null;
69
70 passwordEnabled?: (Scalars["Boolean"] | null) | null;
71
72 phone?: (Scalars["String"] | null) | null;
73
74 planDisplayName?: (Scalars["String"] | null) | null;
75
76 planName?: (Scalars["String"] | null) | null;
77
78 preLaunchEnabled?: (Scalars["Boolean"] | null) | null;
79
80 primaryLocale?: (Scalars["String"] | null) | null;
81
82 province?: (Scalars["String"] | null) | null;
83
84 provinceCode?: (Scalars["String"] | null) | null;
85
86 requiresExtraPaymentsAgreement?: (Scalars["Boolean"] | null) | null;
87
88 setupRequired?: (Scalars["Boolean"] | null) | null;
89
90 shopifyCreatedAt?: Date | Scalars["ISO8601DateString"] | null;
91
92 shopOwner?: (Scalars["String"] | null) | null;
93
94 source?: (Scalars["String"] | null) | null;
95
96 taxShipping?: (Scalars["Boolean"] | null) | null;
97
98 taxesIncluded?: (Scalars["Boolean"] | null) | null;
99
100 shopifyUpdatedAt?: Date | Scalars["ISO8601DateString"] | null;
101
102 productImages?: (ShopifyProductImageHasManyInput | null)[];
103
104 timezone?: (Scalars["String"] | null) | null;
105
106 weightUnit?: (Scalars["String"] | null) | null;
107
108 zipCode?: (Scalars["String"] | null) | null;
109
110 productVariants?: (ShopifyProductVariantHasManyInput | null)[];
111
112 syncs?: (ShopifySyncHasManyInput | null)[];
113
114 products?: (ShopifyProductHasManyInput | null)[];
115}
116
117export interface UpdateShopifyShopArguments {
118 shopifyShop?: UpdateShopifyShopInput | null;
119}
1input UpdateShopifyShopInput {
2 id: GadgetID
3 address1: String
4 address2: String
5 checkoutApiSupported: Boolean
6 city: String
7 cookieConsentLevel: String
8 country: String
9 countryCode: String
10 countryName: String
11 countyTaxes: JSON
12 currency: String
13 customerEmail: String
14 domain: String
15 eligibleForCardReaderGiveaway: Boolean
16 eligibleForPayments: Boolean
17 email: String
18 enabledPresentmentCurrencies: JSON
19 finances: Boolean
20 forceSsl: Boolean
21 googleAppsDomain: String
22 googleAppsLoginEnabled: Boolean
23 hasDiscounts: Boolean
24 hasGiftCards: Boolean
25 hasStorefront: Boolean
26 ianaTimezone: String
27 latitude: Float
28 longitude: Float
29 moneyFormat: String
30 moneyInEmailsFormat: String
31 moneyWithCurrencyFormat: String
32 moneyWithCurrencyInEmailsFormat: String
33 multiLocationEnabled: Boolean
34 myshopifyDomain: String
35 name: String
36 passwordEnabled: Boolean
37 phone: String
38 planDisplayName: String
39 planName: String
40 preLaunchEnabled: Boolean
41 primaryLocale: String
42 province: String
43 provinceCode: String
44 requiresExtraPaymentsAgreement: Boolean
45 setupRequired: Boolean
46 shopifyCreatedAt: DateTime
47 shopOwner: String
48 source: String
49 taxShipping: Boolean
50 taxesIncluded: Boolean
51 shopifyUpdatedAt: DateTime
52 productImages: [ShopifyProductImageHasManyInput]
53 timezone: String
54 weightUnit: String
55 zipCode: String
56 productVariants: [ShopifyProductVariantHasManyInput]
57 syncs: [ShopifySyncHasManyInput]
58 products: [ShopifyProductHasManyInput]
59}
60
61input UpdateShopifyShopArguments {
62 shopifyShop: UpdateShopifyShopInput
63}
Example update Invocation
1const shopifyShopRecord = await api.shopifyShop.update("some-id", {
2 shopifyShop: {
3 // field values for Shopify Shop
4 },
5});
6console.log(shopifyShopRecord.id); //=> a string
1const [result, updateShopifyShop] = useAction(api.shopifyShop.update);
2const { data, error, fetching } = result;
3await updateShopifyShop({
4 id: "some-id",
5 shopifyShop: {
6 // field values for Shopify Shop
7 },
8});
9console.log(data?.id); //=> a string
1mutation ($id: GadgetID!, $shopifyShop: UpdateShopifyShopInput) {
2 updateShopifyShop(id: $id, shopifyShop: $shopifyShop) {
3 success
4 errors {
5 message
6 ... on InvalidRecordError {
7 validationErrors {
8 apiIdentifier
9 message
10 }
11 record
12 model {
13 apiIdentifier
14 }
15 }
16 }
17 shopifyShop {
18 __typename
19 id
20 state
21 accessToken
22 address1
23 address2
24 checkoutApiSupported
25 city
26 cookieConsentLevel
27 country
28 countryCode
29 countryName
30 countyTaxes
31 createdAt
32 currency
33 customerEmail
34 domain
35 eligibleForCardReaderGiveaway
36 eligibleForPayments
37 email
38 enabledPresentmentCurrencies
39 finances
40 forceSsl
41 googleAppsDomain
42 googleAppsLoginEnabled
43 grantedScopes
44 hasDiscounts
45 hasGiftCards
46 hasStorefront
47 ianaTimezone
48 installedViaApiKey
49 latitude
50 longitude
51 moneyFormat
52 moneyInEmailsFormat
53 moneyWithCurrencyFormat
54 moneyWithCurrencyInEmailsFormat
55 multiLocationEnabled
56 myshopifyDomain
57 name
58 passwordEnabled
59 phone
60 planDisplayName
61 planName
62 preLaunchEnabled
63 primaryLocale
64 province
65 provinceCode
66 registeredWebhooks
67 requiresExtraPaymentsAgreement
68 setupRequired
69 shopOwner
70 shopifyCreatedAt
71 shopifyUpdatedAt
72 source
73 taxShipping
74 taxesIncluded
75 timezone
76 updatedAt
77 weightUnit
78 zipCode
79 }
80 }
81}
Variables
json
{ "id": "some-id", "shopifyShop": {} }
Output

update returns the Shopify Shop. In the JS client, the fields returned can be controlled with the select option. In GraphQL, the return format is the action result format, which includes the record if the action was successful. You can include or exclude the fields you need right in the mutation itself.

update Output Data
type UpdateShopifyShopResult {
success: Boolean!
errors: [ExecutionError!]
shopifyShop: ShopifyShop
}

Shopify Shop delete

The delete action destroys the record.

Input

delete operates on one Shopify Shop in particular, identified by the id variable.

Example delete Invocation
await api.shopifyShop.delete("some-id");
const [result, deleteShopifyShop] = useAction(api.shopifyShop.delete);
const { data, error, fetching } = result;
await deleteShopifyShop({
id: "some-id",
});
1mutation ($id: GadgetID!) {
2 deleteShopifyShop(id: $id) {
3 success
4 errors {
5 message
6 ... on InvalidRecordError {
7 validationErrors {
8 apiIdentifier
9 message
10 }
11 record
12 model {
13 apiIdentifier
14 }
15 }
16 }
17 }
18}
Variables
json
{ "id": "some-id" }
Output

delete deletes the record, so it returns void in the JS client. In GraphQL it returns only the success and errors from the action result format.

delete Output Data
type DeleteShopifyShopResult {
success: Boolean!
errors: [ExecutionError!]
}

Shopify Shop uninstall

Input

uninstall operates on one Shopify Shop in particular, identified by the id variable.uninstall accepts the following input parameters:

uninstall Input Data
1export interface UninstallShopifyShopInput {
2 id?: (Scalars["GadgetID"] | null) | null;
3
4 address1?: (Scalars["String"] | null) | null;
5
6 address2?: (Scalars["String"] | null) | null;
7
8 checkoutApiSupported?: (Scalars["Boolean"] | null) | null;
9
10 city?: (Scalars["String"] | null) | null;
11
12 cookieConsentLevel?: (Scalars["String"] | null) | null;
13
14 country?: (Scalars["String"] | null) | null;
15
16 countryCode?: (Scalars["String"] | null) | null;
17
18 countryName?: (Scalars["String"] | null) | null;
19
20 countyTaxes?: (Scalars["JSON"] | null) | null;
21
22 currency?: (Scalars["String"] | null) | null;
23
24 customerEmail?: (Scalars["String"] | null) | null;
25
26 domain?: (Scalars["String"] | null) | null;
27
28 eligibleForCardReaderGiveaway?: (Scalars["Boolean"] | null) | null;
29
30 eligibleForPayments?: (Scalars["Boolean"] | null) | null;
31
32 email?: (Scalars["String"] | null) | null;
33
34 enabledPresentmentCurrencies?: (Scalars["JSON"] | null) | null;
35
36 finances?: (Scalars["Boolean"] | null) | null;
37
38 forceSsl?: (Scalars["Boolean"] | null) | null;
39
40 googleAppsDomain?: (Scalars["String"] | null) | null;
41
42 googleAppsLoginEnabled?: (Scalars["Boolean"] | null) | null;
43
44 hasDiscounts?: (Scalars["Boolean"] | null) | null;
45
46 hasGiftCards?: (Scalars["Boolean"] | null) | null;
47
48 hasStorefront?: (Scalars["Boolean"] | null) | null;
49
50 ianaTimezone?: (Scalars["String"] | null) | null;
51
52 latitude?: (Scalars["Float"] | null) | null;
53
54 longitude?: (Scalars["Float"] | null) | null;
55
56 moneyFormat?: (Scalars["String"] | null) | null;
57
58 moneyInEmailsFormat?: (Scalars["String"] | null) | null;
59
60 moneyWithCurrencyFormat?: (Scalars["String"] | null) | null;
61
62 moneyWithCurrencyInEmailsFormat?: (Scalars["String"] | null) | null;
63
64 multiLocationEnabled?: (Scalars["Boolean"] | null) | null;
65
66 myshopifyDomain?: (Scalars["String"] | null) | null;
67
68 name?: (Scalars["String"] | null) | null;
69
70 passwordEnabled?: (Scalars["Boolean"] | null) | null;
71
72 phone?: (Scalars["String"] | null) | null;
73
74 planDisplayName?: (Scalars["String"] | null) | null;
75
76 planName?: (Scalars["String"] | null) | null;
77
78 preLaunchEnabled?: (Scalars["Boolean"] | null) | null;
79
80 primaryLocale?: (Scalars["String"] | null) | null;
81
82 province?: (Scalars["String"] | null) | null;
83
84 provinceCode?: (Scalars["String"] | null) | null;
85
86 requiresExtraPaymentsAgreement?: (Scalars["Boolean"] | null) | null;
87
88 setupRequired?: (Scalars["Boolean"] | null) | null;
89
90 shopifyCreatedAt?: Date | Scalars["ISO8601DateString"] | null;
91
92 shopOwner?: (Scalars["String"] | null) | null;
93
94 source?: (Scalars["String"] | null) | null;
95
96 taxShipping?: (Scalars["Boolean"] | null) | null;
97
98 taxesIncluded?: (Scalars["Boolean"] | null) | null;
99
100 shopifyUpdatedAt?: Date | Scalars["ISO8601DateString"] | null;
101
102 productImages?: (