-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
887 lines (738 loc) · 16.5 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
"""User external authentication access token"""
input AccessToken {
access_token: String!
resource_owner_id: ID
refresh_token: String
expires_in: Int
expires: Int
}
"""Address model"""
type address {
id: ID
type: address_type_enum @deprecated(reason: "Deprecated together with cart.address_list")
email: String
title: String
first_name: String
last_name: String
country: country
state: state
county: String
city: String
address: String
zip: String
phone: String
fax: String @deprecated(reason: "Default X-Cart system doesn't have fax field")
}
"""Address input type"""
input address_input {
email: String
title: String
first_name: String
last_name: String
country_code: String
state_code: String
county: String
city: String
address: String
zip: String
phone: String
fax: String
}
"""Address type enumeration"""
enum address_type_enum {
"""Shipping address"""
SHIPPING_TYPE
"""Billing address"""
BILLING_TYPE
}
"""Application configuration"""
type app_config {
store_platform: String
store_version: String
currency: currency
default_language: language
default_country: country
date_format: String
time_format: String
contact_email: String
contact_phone: String
contact_address: String
contact_fax: String
terms_and_conditions: String
is_webview_checkout_flow: Boolean
email_as_login: Boolean
}
"""Application common data"""
type app_data {
currencies: [currency]
languages: [language]
countries: [country]
states: [state]
profile_fields: [profile_field]
memberships: [membership]
modules: [module]
home_page_widgets: [homePageWidget]
external_auth_providers: [authProvider]
}
"""User authentication input type"""
input AuthInput {
login: String
password: String
}
"""External OAuth2-compatible authorization provider"""
type authProvider {
"""Auth provider display name"""
display_name: String
"""Auth provider service name"""
service_name: String
"""
Authorize grant URL. Open that in WebView to allow user to pass the grant and code acquiring process.
"""
authorize_url: String
}
"""Banner model"""
type banner {
id: ID
image_url: String
type: String
data: String
}
"""Cart model"""
type cart {
id: ID
token: String
cart_url: String
checkout_url: String
webview_flow_url: String
user: user
address_list: [address] @deprecated(reason: "Use cart.shipping_address and cart.billing_address instead separately. See user.address_list for more info.")
shipping_address: address
billing_address: address
items: [orderItem]
payment: payment
shipping: shipping
coupons: [coupon]
"""Available shipping methods for cart"""
shipping_methods: [shipping]
"""Available payment methods for cart"""
payment_methods: [payment]
notes: String
markups_list: [String]
total: Float
total_amount: Int
checkout_ready: Boolean
payment_selection_ready: Boolean
same_address: Boolean
errors: [cart_error]
}
"""Cart error enumeration"""
enum cart_error {
"""Cart is empty"""
EMPTY_CART
"""No payment selected"""
NO_PAYMENT_SELECTED
"""No shipping selected"""
NO_SHIPPING_SELECTED
"""No shipping available"""
NO_SHIPPING_AVAILABLE
"""No shipping address"""
NO_SHIPPING_ADDRESS
"""Non full shipping address, some required fields are invalid"""
NON_FULL_SHIPPING_ADDRESS
}
"""Category model"""
type category implements collection_item {
id: ID
category_name: String
description: String
category_url: String
image_url: String
banner_url: String
parent_id: ID
products_count: Int
subcategories_count: Int
subcategories(
"""Subset from"""
from: Int
"""Subset size"""
size: Int
): [category]
products(
"""Subset from"""
from: Int
"""Subset size"""
size: Int
"""Filters"""
filters: products_filter_input
): [product]
filters: [category_products_filter]
}
"""Category products filter model"""
union category_products_filter = select_field | switch_field | text_field | value_range_field
"""Client input type"""
input ClientInput {
unique_id: String!
app_id: String
app_version: String
push_id: String
platform: String
system_name: String
system_version: String
device_name: String
manufacturer: String
model: String
}
"""Object collection"""
type collection {
count: Int
objects: [collection_item]
}
"""Object as a part of collection"""
interface collection_item {
id: ID
}
"""Collection type enumeration"""
enum collection_type {
"""Products collection"""
products
"""Categories collection"""
categories
}
"""Country model"""
type country {
code: String
name: String
states: [state]
}
"""Coupon model"""
type coupon {
id: ID
code: String
name: String
rate: Float
type: String
}
"""Currency model"""
type currency {
code: String
name: String
prefix: String
suffix: String
e: Int
delimiter: String
thousands_delimiter: String
}
"""User external authentication input type"""
input ExternalAuthInput {
provider: String!
access_token: AccessToken!
}
"""FAQ model"""
type faq {
question: String
answer: String
}
"""Products filter view type enumeration"""
enum form_field_type {
FIELD_TYPE_TEXT
FIELD_TYPE_EMAIL
FIELD_TYPE_PHONE
FIELD_TYPE_SEARCH
FIELD_TYPE_SELECT
FIELD_TYPE_VALUE_RANGE
FIELD_TYPE_DATE
FIELD_TYPE_DATE_RANGE
FIELD_TYPE_SWITCH
FIELD_TYPE_QUANTITY
}
"""Home page widgets information"""
type homePageWidget {
display_name: String
service_name: String
enabled: Boolean
type: String
params: widgetParams
}
"""Language model"""
type language {
code: String
name: String
}
input list_order_filter {
"""Property name"""
name: String
"""Order: asc or desc"""
order: String
}
"""Membership model"""
type membership {
id: ID
name: String
}
"""Module model"""
type module {
name: String
enabled: Boolean
}
type Mutation {
"""Add product to cart"""
addProductToCart(product_id: ID!, amount: Int, attributes: [String]): cart
"""Remove orderItem from cart"""
removeCartItem(item_id: ID!): cart
"""Change orderItem amount"""
changeItemAmountByModifier(item_id: ID!, amount_modifier: Int!): cart
"""Change orderItem amount"""
changeItemAmount(item_id: ID!, amount: Int!): cart
"""Add address"""
addAddress(type: address_type_enum!, address: address_input!): cart
"""Change address"""
changeAddress(type: address_type_enum!, address: address_input!): cart
"""Change payment method of the cart"""
changePaymentMethod(payment_id: ID!): cart
"""Change payment method fields for cart"""
changePaymentFields(fields: [payment_fields_input]!): cart
"""Change shipping method of the cart"""
changeShippingMethod(shipping_id: ID!): cart
"""Change customer notes of the cart"""
changeCustomerNotes(notes: String!): cart
"""Select address by id"""
selectAddress(type: address_type_enum!, address_id: ID!): cart
"""Remove address from address book"""
deleteUserAddress(address_id: ID!): user
"""Remove address from address book"""
changeUserAddress(address_id: ID!, address: address_input!): user
"""Update profile"""
updateUserRegisterData(oldPassword: String, data: UserUpdateInput!): user
"""Get auth token for plain client ID or optionally for system user"""
auth(auth: AuthInput!, client: ClientInput): String
"""
Get auth token for plain client ID or optionally for system user by using external token
"""
externalAuth(auth: ExternalAuthInput!, client: ClientInput): String
"""Merge anonymous profile with current logged in registered profile"""
mergeProfiles(anonymous_jwt: String): Boolean
"""Recover password for provided login"""
recoverPassword(login: String!): Boolean
"""Register profile"""
register(data: UserRegisterInput!, client: ClientInput): registrationResult
"""Add product to wishlist"""
addProductToWishlist(product_id: ID!): wishlist
"""Remove product from wishlist"""
removeProductFromWishlist(product_id: ID!): wishlist
"""Put offer for product"""
putOffer(name: String!, email: String!, offer_qty: Int!, offer_price: Float!, product_id: ID!): offer
"""Add coupon to cart"""
addCartCoupon(code: String!): cart
"""Remove coupon from cart"""
removeCartCoupon(code: String!): cart
"""Send message to service"""
contactUs(name: String!, email: String!, subject: String!, message: String!, login: String, company: String, address: String, city: String, country: String, state: String, zipcode: String, phone: String, fax: String, url: String, department: String): String
"""Sign-up for emails"""
signUpForNews(email: String!): Boolean
}
"""Offer model"""
type offer {
id: ID
customer_notes: String
admin_notes: String
status: String
status_name: String
product_id: ID
product_name: String
product_price: Float
offer_price: Float
offer_amount: Int
date: String
}
"""OrderItem option model"""
type order_item_options {
id: ID
name: String
value: String
option_id: ID
option_value_id: ID
}
"""OrderItem model"""
type orderItem {
id: ID
product: product
sku: String
name: String
price: Float
amount: Int
total: Float
options: [order_item_options]
taxes: [String]
is_booking: Boolean
date_from: String
date_to: String
}
"""Payment model"""
type payment {
id: ID
service_name: String
payment_name: String
details: String
fields: [payment_field]
}
"""Payment field model"""
type payment_field {
id: ID
name: String
value: String
}
input payment_fields_input {
"""Payment fields id"""
id: ID
"""Payment fields value"""
value: String
}
"""Product model"""
type product implements collection_item {
id: ID
product_code: String
product_name: String
short_description: String
short_description_html: String
description: String
description_html: String
small_image_url: String
image_url: String
images: [String]
product_url: String
weight: Float
inventory_enabled: Boolean
amount: Int
price: Float
display_price: Float
review_rate: Float
votes_count: Int
enabled: Boolean
available: Boolean
coming_soon: Boolean
expected_date: Int
attributes: [product_attribute_group]
options: [product_option]
on_sale: Boolean
sale_value: Float
sale_type: String
bookable: Boolean
is_wishlisted: Boolean
stickers: [productSticker]
tags: [productTag]
vendor: vendor
}
"""Product attribute"""
type product_attribute {
label: String
value: String
group: String
}
"""Product attribute group"""
type product_attribute_group {
id: ID
label: String
pos: Int
attributes: [product_attribute]
}
"""Product option"""
type product_option {
id: ID
option_name: String
option_type: String
options: [product_option_value]
}
"""Product option value"""
type product_option_value {
id: ID
value: String
default: Boolean
modifier_type: String
modifier_value: Float
}
"""Products filter input"""
input products_filter_input {
"""Search query string"""
searchFilter: String
"""Search enabled items"""
enabled: Boolean
"""Search products by stock status"""
stockFilter: Boolean
"""Custom json-encoded filters"""
custom: [String]
"""Category id to filter"""
categoryId: ID
"""Search in subcategories"""
inSubcats: Boolean
"""Search bestsellers"""
bestsellers: Boolean
"""Search featured products"""
featured: Boolean
"""Search new arrived products"""
new_arrivals: Boolean
"""Search products on sale. Requires CDev-Sale addon."""
sale: Boolean
"""Search products by tag. Requires XC-ProductTags addon."""
tagFilter: String
"""Search products by vendor id. Requires XC-MultiVendor addon."""
vendorId: ID
"""Search products by stock status"""
priceFilter: value_range_input
"""Order by"""
orderByFilter: list_order_filter
}
"""Product option"""
type productSticker {
name: String
text_color: String
bg_color: String
}
"""Product tag"""
type productTag {
id: ID
name: String
position: Int
}
"""Profile field (aka addressField) model"""
type profile_field {
service_name: String
type: String
name: String
placeholder: String
required: Boolean
}
type Query {
"""Single product"""
product(
"""Product id"""
id: ID!
): product
"""Products list"""
products(
"""Subset from"""
from: Int
"""Subset size"""
size: Int
"""Filters"""
filters: products_filter_input
): [product]
"""Single category"""
category(
"""Category id"""
id: ID!
): category
"""Categories list"""
categories(
"""Subset from"""
from: Int
"""Subset size"""
size: Int
"""Parent category ID"""
parent_id: ID
"""Search query string"""
search: String
"""Search only enabled categories"""
enabled: Boolean
): [category]
"""Catalog"""
catalog: [category]
"""Countries list"""
countries: [country]
"""States list"""
states: [state]
"""Currencies list"""
currencies: [currency]
"""Banners"""
banners: [banner]
"""Current cart"""
cart: cart
"""User data"""
user(
"""User id (current user id is used if not provided)"""
id: ID
): user
"""Product tags. Requires XC-ProductTags addon."""
productTags: [productTag]
"""FAQ items. Requires Guru-FAQ addon."""
faq: [faq]
"""Offers list. Requires CSI-MakeAnOffer addon."""
offers: [offer]
"""Vendors list. Requires XC-MultiVendor addon."""
vendors: [vendor]
"""Wishlist. Requires QSL-MyWishlist addon."""
wishlist: wishlist
"""Application configuration"""
appConfig: app_config
"""Application common Data"""
appData: app_data
"""Object collection"""
collection(
"""Object type"""
type: collection_type!
"""Subset from"""
from: Int
"""Subset size"""
size: Int
"""Filters"""
filters: products_filter_input
"""Parent category ID"""
parent_id: ID
"""Search query string"""
search: String
"""Search only enabled categories"""
enabled: Boolean
): collection
}
"""Registration result"""
type registrationResult {
id: ID
jwt: String
user: user
}
"""Select Field model"""
type select_field {
name: String
label: String
type: form_field_type
defaultValue: String
required: Boolean
options: [select_field_value]
multiple: Boolean
}
"""Form Field model"""
type select_field_value {
label: String
value: String
}
"""Shipping model"""
type shipping {
id: ID
shipping_name: String
details: String
rate: Float
}
"""State model"""
type state {
code: String
name: String
country: country
}
"""Switch Field model"""
type switch_field {
name: String
label: String
type: form_field_type
defaultValue: String
required: Boolean
}
"""Text Field model"""
type text_field {
name: String
label: String
type: form_field_type
defaultValue: String
required: Boolean
}
"""User model"""
type user {
id: ID
user_type: user_type
title: String
first_name: String
last_name: String
email: String
phone: String
enabled: Boolean
registered: Boolean
registered_date: Int
last_login_date: Int
language: String
address_list: [address]
orders_count: Int
vendor_info: [String]
auth_id: String
auth_token: String
login: String
company: String
url: String
tax_number: String
contact_us_url: String
account_details_url: String
orders_list_url: String
address_book_url: String
messages_url: String
}
"""User type enumeration"""
enum user_type {
"""Customer"""
USER_TYPE_CUSTOMER
"""Anonymous customer"""
USER_TYPE_ANONYMOUS
"""Staff"""
USER_TYPE_STAFF
"""Vendor"""
USER_TYPE_VENDOR
}
"""Register user input type"""
input UserRegisterInput {
email: String!
password: String!
password_conf: String!
login: String
first_name: String
last_name: String
company: String
url: String
tax_number: String
}
"""Update user input type"""
input UserUpdateInput {
email: String!
password: String
password_conf: String
old_password: String
login: String
first_name: String
last_name: String
company: String
url: String
tax_number: String
}
"""Value Range Field model"""
type value_range_field {
name: String
label: String
type: form_field_type
defaultValue: String
required: Boolean
minValue: Float
maxValue: Float
}
input value_range_input {
"""From value"""
from: Float
"""To value"""
to: Float
}
"""Vendor information model"""
type vendor {
id: ID
email: String
company_name: String
image: String
location: String
description: String
description_html: String
}
"""widget params data"""
type widgetParams {
"""JSON-encoded object for use in products query"""
filters: String
}
"""WishList model"""
type wishlist {
id: ID
user_id: ID
count: Int
items: [product]
}