From 1451de9df1bb999ff37fe231e6adb28466ca7d99 Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Fri, 18 Sep 2020 01:24:58 +0200 Subject: [PATCH 01/24] update artemis version --- example/pubspec.lock | 2 +- example/pubspec.yaml | 10 ++-------- pubspec.yaml | 7 ++++--- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index a35d490..9499f2e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -28,7 +28,7 @@ packages: name: artemis url: "https://pub.dartlang.org" source: hosted - version: "2.2.2" + version: "5.1.0" async: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 6087a90..fccb731 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -3,7 +3,7 @@ description: Demonstrates how to use the mmd_ecommerce_fl_lib plugin. # The following line prevents the package from being accidentally published to # pub.dev using `pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: "none" # Remove this line if you wish to publish to pub.dev environment: sdk: ">=2.7.0 <3.0.0" @@ -27,30 +27,24 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - artemis: ^2.1.4 + artemis: ^5.1.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec - # The following section is specific to Flutter. flutter: - # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. uses-material-design: true - # To add assets to your application, add an assets section, like this: # assets: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg - # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. - # For details regarding adding assets from package dependencies, see # https://flutter.dev/assets-and-images/#from-packages - # To add custom fonts to your application, add a fonts section here, # in this "flutter" section. Each entry in this list should have a # "family" key with the font family name, and a "fonts" key with a diff --git a/pubspec.yaml b/pubspec.yaml index b917680..22b8c98 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,6 @@ name: mmd_ecommerce_fl_lib -description: It is a backend library using GraphQl to facilitate connection to our different e-commerce backend endpoints. +description: It is a backend library using GraphQl to facilitate connection to + our different e-commerce backend endpoints. version: 0.0.9 homepage: https://github.com/BeshoyMelika/mmd-ecommerce-fl-lib @@ -13,11 +14,11 @@ dependencies: json_serializable: ^3.2.3 equatable: ^1.0.2 gql: ^0.12.0 - meta: '>=1.0.0 <2.0.0' # only if you have non nullable fields + meta: ">=1.0.0 <2.0.0" # only if you have non nullable fields path_provider: ^1.5.1 graphql_flutter: ^3.1.0 analyzer: ^0.39.2+1 - artemis: ^2.1.4 + artemis: ^5.1.0 json_annotation: ^3.0.1 http: ^0.12.0+4 From 12d4f43cff8be289176fac59529c5d2570f19be2 Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Fri, 18 Sep 2020 02:28:58 +0200 Subject: [PATCH 02/24] update schema --- general.schema.graphql | 4868 ++++------------------------------------ pubspec.lock | 2 +- 2 files changed, 437 insertions(+), 4433 deletions(-) diff --git a/general.schema.graphql b/general.schema.graphql index 21e6c76..1fac4ce 100644 --- a/general.schema.graphql +++ b/general.schema.graphql @@ -1,4432 +1,436 @@ -{ - "data": { - "__schema": { - "queryType": { - "name": "Query" - }, - "mutationType": { - "name": "Mutation" - }, - "subscriptionType": null, - "types": [ - { - "kind": "OBJECT", - "name": "Query", - "description": null, - "fields": [ - { - "name": "cities", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "City", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "areas", - "description": null, - "args": [ - { - "name": "city_id", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Area", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "profile", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "User", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "addresses", - "description": null, - "args": [ - { - "name": "first", - "description": "Limits number of fetched elements.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "page", - "description": "The offset from which elements are returned.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "UserAddressPaginator", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "attributes", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Attribute", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "products", - "description": null, - "args": [ - { - "name": "orderBy", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "ProductsOrderByOrderByClause", - "ofType": null - } - } - }, - "defaultValue": null - }, - { - "name": "filter", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "ProductFilter", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": "Limits number of fetched elements.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "page", - "description": "The offset from which elements are returned.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "ProductPaginator", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "relatedProducts", - "description": null, - "args": [ - { - "name": "id", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Product", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "brands", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Brand", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "categories", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Category", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "stores", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Store", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cart", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Cart", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "shippingFees", - "description": null, - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "OrderInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "orders", - "description": null, - "args": [ - { - "name": "first", - "description": "Limits number of fetched elements.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "page", - "description": "The offset from which elements are returned.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "OrderPaginator", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "sliders", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Slider", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ratings", - "description": null, - "args": [ - { - "name": "product_id", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "first", - "description": "Limits number of fetched elements.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "page", - "description": "The offset from which elements are returned.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "RatingPaginator", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "getVoucherByCode", - "description": null, - "args": [ - { - "name": "code", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Voucher", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "wishlist", - "description": null, - "args": [ - { - "name": "first", - "description": "Limits number of fetched elements.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "page", - "description": "The offset from which elements are returned.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "WishlistPaginator", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "City", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "ID", - "description": "The `ID` scalar type represents a unique identifier, often used to\nrefetch an object or as key for a cache. The ID type appears in a JSON\nresponse as a String; however, it is not intended to be human-readable.\nWhen expected as an input type, any string (such as `\"4\"`) or integer\n(such as `4`) input value will be accepted as an ID.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "String", - "description": "The `String` scalar type represents textual data, represented as UTF-8\ncharacter sequences. The String type is most often used by GraphQL to\nrepresent free-form human-readable text.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Area", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "city", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "City", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "User", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "email", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mobile", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Int", - "description": "The `Int` scalar type represents non-fractional signed whole numeric\nvalues. Int can represent values between -(2^31) and 2^31 - 1. ", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "UserAddressPaginator", - "description": "A paginated list of UserAddress items.", - "fields": [ - { - "name": "paginatorInfo", - "description": "Pagination information about the list of items.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PaginatorInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "data", - "description": "A list of UserAddress items.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "UserAddress", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "PaginatorInfo", - "description": "Pagination information about the corresponding list of items.", - "fields": [ - { - "name": "count", - "description": "Total count of available items in the page.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "currentPage", - "description": "Current pagination page.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "firstItem", - "description": "Index of first item in the current page.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "hasMorePages", - "description": "If collection has more pages.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "lastItem", - "description": "Index of last item in the current page.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "lastPage", - "description": "Last page number of the collection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "perPage", - "description": "Number of items per page in the collection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "total", - "description": "Total items available in the collection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Boolean", - "description": "The `Boolean` scalar type represents `true` or `false`.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "UserAddress", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "first_name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "last_name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "area", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Area", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "info", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "additional_info", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mobile", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "lat", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "lng", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDefault", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Attribute", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "options", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "ProductsOrderByOrderByClause", - "description": "Order by clause for the `orderBy` argument on the query `products`.", - "fields": null, - "inputFields": [ - { - "name": "field", - "description": "The column that is used for ordering.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ProductsOrderByColumn", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "order", - "description": "The direction that is used for ordering.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "SortOrder", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "ProductsOrderByColumn", - "description": "Allowed column names for the `orderBy` argument on the query `products`.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "ID", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NAME", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "SortOrder", - "description": "The available directions for ordering a list of records.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "ASC", - "description": "Sort records in ascending order.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "DESC", - "description": "Sort records in descending order.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "ProductFilter", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "id", - "description": null, - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "name", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "sku", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "category", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "brand", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "store", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ProductPaginator", - "description": "A paginated list of Product items.", - "fields": [ - { - "name": "paginatorInfo", - "description": "Pagination information about the list of items.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PaginatorInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "data", - "description": "A list of Product items.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Product", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Product", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "details", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "ProductData", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "store", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Store", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "price", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "available", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ratings", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Rating", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "averageRating", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ProductData", - "description": null, - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "sku", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "brand", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Brand", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "category", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Category", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "media", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Media", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cover", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Media", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "unit", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Unit", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Brand", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Category", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cover", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Media", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "children", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Category", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Media", - "description": null, - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mime_type", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "url", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Unit", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Store", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Rating", - "description": null, - "fields": [ - { - "name": "rating", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "review", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "user", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "User", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "product", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Product", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Cart", - "description": null, - "fields": [ - { - "name": "items", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CartItem", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "total", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CartItem", - "description": null, - "fields": [ - { - "name": "product", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Product", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "quantity", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "available", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "OrderInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "address_id", - "description": null, - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "voucher_id", - "description": null, - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderPaginator", - "description": "A paginated list of Order items.", - "fields": [ - { - "name": "paginatorInfo", - "description": "Pagination information about the list of items.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PaginatorInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "data", - "description": "A list of Order items.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Order", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Order", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "address", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "OrderAddress", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "total", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "payment_type", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "items", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OrderItem", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderAddress", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "first_name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "last_name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "info", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "additional_info", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mobile", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "lat", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "lng", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderItem", - "description": null, - "fields": [ - { - "name": "quantity", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "price", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "product", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Product", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Slider", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "link", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cover", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Media", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RatingPaginator", - "description": "A paginated list of Rating items.", - "fields": [ - { - "name": "paginatorInfo", - "description": "Pagination information about the list of items.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PaginatorInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "data", - "description": "A list of Rating items.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Rating", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Voucher", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "code", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "discount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "discount_type", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "WishlistPaginator", - "description": "A paginated list of Wishlist items.", - "fields": [ - { - "name": "paginatorInfo", - "description": "Pagination information about the list of items.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PaginatorInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "data", - "description": "A list of Wishlist items.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Wishlist", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Wishlist", - "description": null, - "fields": [ - { - "name": "product", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Product", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Mutation", - "description": null, - "fields": [ - { - "name": "login", - "description": null, - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "LoginInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "AuthPayload", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "forgetPassword", - "description": null, - "args": [ - { - "name": "email", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "resetPassword", - "description": null, - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "ResetPasswordInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "register", - "description": null, - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "RegisterInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "User", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "refreshToken", - "description": null, - "args": [ - { - "name": "token", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "AuthPayload", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "logout", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "createAddress", - "description": null, - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "AddressInput", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updateAddress", - "description": null, - "args": [ - { - "name": "id", - "description": null, - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "input", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "AddressInput", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deleteAddress", - "description": null, - "args": [ - { - "name": "id", - "description": null, - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updateProfile", - "description": null, - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "UpdateProfile", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "addToCart", - "description": null, - "args": [ - { - "name": "items", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "CartInput", - "ofType": null - } - } - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "placeCashOnDeliveryOrder", - "description": null, - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "OrderInput", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "addReview", - "description": null, - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "ReviewInput", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "addItemToWishlist", - "description": null, - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "WishlistInput", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deleteItemFromWishlist", - "description": null, - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "WishlistInput", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "LoginInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "email", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "password", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "device_token", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AuthPayload", - "description": null, - "fields": [ - { - "name": "token_type", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "expires_in", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "access_token", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "refresh_token", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "ResetPasswordInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "email", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "new_password", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "token", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "RegisterInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "name", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "email", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "password", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "password_confirmation", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "AddressInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "first_name", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "last_name", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "area_id", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "info", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "additional_info", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "mobile", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "lat", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "lng", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "isDefault", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "UpdateProfile", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "name", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "mobile", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "CartInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "product_id", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "quantity", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "ReviewInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "product_id", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "rating", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "review", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "WishlistInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "product_id", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "PageInfo", - "description": "Pagination information about the corresponding list of items.", - "fields": [ - { - "name": "hasNextPage", - "description": "When paginating forwards, are there more items?", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "hasPreviousPage", - "description": "When paginating backwards, are there more items?", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "startCursor", - "description": "When paginating backwards, the cursor to continue.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "endCursor", - "description": "When paginating forwards, the cursor to continue.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "total", - "description": "Total number of node in connection.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "count", - "description": "Count of nodes in current request.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "currentPage", - "description": "Current page of request.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "lastPage", - "description": "Last page in connection.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "OrderByClause", - "description": "Allows ordering a list of records.", - "fields": null, - "inputFields": [ - { - "name": "field", - "description": "The column that is used for ordering.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "order", - "description": "The direction that is used for ordering.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "SortOrder", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "Trashed", - "description": "Specify if you want to include or exclude trashed results from a query.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "ONLY", - "description": "Only return trashed results.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "WITH", - "description": "Return both trashed and non-trashed results.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "WITHOUT", - "description": "Only return non-trashed results.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Float", - "description": "The `Float` scalar type represents signed double-precision fractional\nvalues as specified by\n[IEEE 754](http:\/\/en.wikipedia.org\/wiki\/IEEE_floating_point). ", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Schema", - "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", - "fields": [ - { - "name": "types", - "description": "A list of all types supported by this server.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "queryType", - "description": "The type that query operations will be rooted at.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mutationType", - "description": "If this server supports mutation, the type that mutation operations will be rooted at.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "subscriptionType", - "description": "If this server support subscription, the type that subscription operations will be rooted at.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "directives", - "description": "A list of all directives supported by this server.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Directive", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Type", - "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", - "fields": [ - { - "name": "kind", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__TypeKind", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "fields", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Field", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "interfaces", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "possibleTypes", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "enumValues", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__EnumValue", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "inputFields", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ofType", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__TypeKind", - "description": "An enum describing what kind of type a given `__Type` is.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "SCALAR", - "description": "Indicates this type is a scalar.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": "Indicates this type is an object. `fields` and `interfaces` are valid fields.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "Indicates this type is a union. `possibleTypes` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "Indicates this type is an enum. `enumValues` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": "Indicates this type is an input object. `inputFields` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "LIST", - "description": "Indicates this type is a list. `ofType` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NON_NULL", - "description": "Indicates this type is a non-null. `ofType` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Field", - "description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__InputValue", - "description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValue", - "description": "A GraphQL-formatted string representing the default value for this input value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__EnumValue", - "description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Directive", - "description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locations", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__DirectiveLocation", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "onOperation", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": true, - "deprecationReason": "Use `locations`." - }, - { - "name": "onFragment", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": true, - "deprecationReason": "Use `locations`." - }, - { - "name": "onField", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": true, - "deprecationReason": "Use `locations`." - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__DirectiveLocation", - "description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "QUERY", - "description": "Location adjacent to a query operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MUTATION", - "description": "Location adjacent to a mutation operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SUBSCRIPTION", - "description": "Location adjacent to a subscription operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD", - "description": "Location adjacent to a field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_DEFINITION", - "description": "Location adjacent to a fragment definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_SPREAD", - "description": "Location adjacent to a fragment spread.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INLINE_FRAGMENT", - "description": "Location adjacent to an inline fragment.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCHEMA", - "description": "Location adjacent to a schema definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCALAR", - "description": "Location adjacent to a scalar definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": "Location adjacent to an object type definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD_DEFINITION", - "description": "Location adjacent to a field definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ARGUMENT_DEFINITION", - "description": "Location adjacent to an argument definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": "Location adjacent to an interface definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "Location adjacent to a union definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "Location adjacent to an enum definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM_VALUE", - "description": "Location adjacent to an enum value definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": "Location adjacent to an input object type definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_FIELD_DEFINITION", - "description": "Location adjacent to an input object field definition.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - } - ], - "directives": [ - { - "name": "include", - "description": "Directs the executor to include this field or fragment only when the `if` argument is true.", - "locations": [ - "FIELD", - "FRAGMENT_SPREAD", - "INLINE_FRAGMENT" - ], - "args": [ - { - "name": "if", - "description": "Included when true.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - } - ] - }, - { - "name": "skip", - "description": "Directs the executor to skip this field or fragment when the `if` argument is true.", - "locations": [ - "FIELD", - "FRAGMENT_SPREAD", - "INLINE_FRAGMENT" - ], - "args": [ - { - "name": "if", - "description": "Skipped when true.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - } - ] - }, - { - "name": "deprecated", - "description": "Marks an element of a GraphQL schema as no longer supported.", - "locations": [ - "FIELD_DEFINITION", - "ENUM_VALUE" - ], - "args": [ - { - "name": "reason", - "description": "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted in [Markdown](https:\/\/daringfireball.net\/projects\/markdown\/).", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": "\"No longer supported\"" - } - ] - } - ] - } - } -} \ No newline at end of file +type Query { + cities: [City] + areas(city_id: ID!): [Area] + profile: User + addresses( + # Limits number of fetched elements. + first: Int! + + # The offset from which elements are returned. + page: Int + ): UserAddressPaginator + attributes: [Attribute] + products( + orderBy: [ProductsOrderByOrderByClause!] + filter: ProductFilter + + # Limits number of fetched elements. + first: Int! + + # The offset from which elements are returned. + page: Int + ): ProductPaginator + relatedProducts(id: ID!): [Product] + brands: [Brand!] + categories: [Category!] + stores: [Store!] + cart: Cart + shippingFees(input: OrderInput!): String + orders( + # Limits number of fetched elements. + first: Int! + + # The offset from which elements are returned. + page: Int + ): OrderPaginator + sliders: [Slider!] + ratings( + product_id: ID! + + # Limits number of fetched elements. + first: Int! + + # The offset from which elements are returned. + page: Int + ): RatingPaginator + getVoucherByCode(code: String!): Voucher + wishlist( + # Limits number of fetched elements. + first: Int! + + # The offset from which elements are returned. + page: Int + ): WishlistPaginator +} + +type City { + id: ID + name: String +} + +type Area { + id: ID + name: String + city: City +} + +type User { + id: ID + name: String + email: String + mobile: String +} + +# A paginated list of UserAddress items. +type UserAddressPaginator { + # Pagination information about the list of items. + paginatorInfo: PaginatorInfo! + + # A list of UserAddress items. + data: [UserAddress!]! +} + +# Pagination information about the corresponding list of items. +type PaginatorInfo { + # Total count of available items in the page. + count: Int! + + # Current pagination page. + currentPage: Int! + + # Index of first item in the current page. + firstItem: Int + + # If collection has more pages. + hasMorePages: Boolean! + + # Index of last item in the current page. + lastItem: Int + + # Last page number of the collection. + lastPage: Int! + + # Number of items per page in the collection. + perPage: Int! + + # Total items available in the collection. + total: Int! +} + +type UserAddress { + id: ID! + first_name: String + last_name: String + area: Area! + info: String! + additional_info: String + mobile: String + lat: String + lng: String + isDefault: Boolean +} + +type Attribute { + id: ID + name: String + options: [String] +} + +# Order by clause for the `orderBy` argument on the query `products`. +input ProductsOrderByOrderByClause { + # The column that is used for ordering. + field: ProductsOrderByColumn! + + # The direction that is used for ordering. + order: SortOrder! +} + +# Allowed column names for the `orderBy` argument on the query `products`. +enum ProductsOrderByColumn { + ID + NAME +} + +# The available directions for ordering a list of records. +enum SortOrder { + # Sort records in ascending order. + ASC + + # Sort records in descending order. + DESC +} + +input ProductFilter { + id: ID + name: String + sku: String + category: [ID] + brand: [ID] + store: [ID] +} + +# A paginated list of Product items. +type ProductPaginator { + # Pagination information about the list of items. + paginatorInfo: PaginatorInfo! + + # A list of Product items. + data: [Product!]! +} + +type Product { + id: ID + details: ProductData + store: Store + price: String + available: Boolean + ratings: [Rating] + averageRating: String +} + +type ProductData { + name: String + sku: String + description: String + brand: Brand! + category: Category! + media: [Media] + cover: Media + unit: Unit +} + +type Brand { + id: ID + name: String +} + +type Category { + id: ID + name: String + cover: Media + children: [Category] +} + +type Media { + name: String + mime_type: String + url: String +} + +type Unit { + id: ID + name: String +} + +type Store { + id: ID + name: String +} + +type Rating { + rating: Int + review: String + user: User + product: Product +} + +type Cart { + items: [CartItem] + total: String +} + +type CartItem { + product: Product + quantity: Int + available: Boolean +} + +input OrderInput { + address_id: ID + voucher_id: ID +} + +# A paginated list of Order items. +type OrderPaginator { + # Pagination information about the list of items. + paginatorInfo: PaginatorInfo! + + # A list of Order items. + data: [Order!]! +} + +type Order { + id: ID + address: OrderAddress + total: String + payment_type: String + items: [OrderItem] +} + +type OrderAddress { + id: ID! + first_name: String + last_name: String + info: String + additional_info: String + mobile: String + lat: String + lng: String +} + +type OrderItem { + quantity: String + price: String + product: Product +} + +type Slider { + id: ID + title: String + description: String + link: String + cover: Media +} + +# A paginated list of Rating items. +type RatingPaginator { + # Pagination information about the list of items. + paginatorInfo: PaginatorInfo! + + # A list of Rating items. + data: [Rating!]! +} + +type Voucher { + id: ID + code: String + discount: Int + discount_type: String +} + +# A paginated list of Wishlist items. +type WishlistPaginator { + # Pagination information about the list of items. + paginatorInfo: PaginatorInfo! + + # A list of Wishlist items. + data: [Wishlist!]! +} + +type Wishlist { + product: Product +} + +type Mutation { + login(input: LoginInput!): AuthPayload! + forgetPassword(email: String!): Boolean! + resetPassword(input: ResetPasswordInput!): Boolean! + register(input: RegisterInput!): User! + refreshToken(token: String!): AuthPayload! + logout: Boolean + createAddress(input: AddressInput): Boolean + updateAddress(id: ID, input: AddressInput): Boolean + deleteAddress(id: ID): Boolean + updateProfile(input: UpdateProfile): Boolean + addToCart(items: [CartInput!]!): Boolean + placeCashOnDeliveryOrder(input: OrderInput): Boolean + addReview(input: ReviewInput): Boolean + addItemToWishlist(input: WishlistInput): Boolean + deleteItemFromWishlist(input: WishlistInput): Boolean +} + +input LoginInput { + email: String! + password: String! + device_token: String! +} + +type AuthPayload { + token_type: String + expires_in: Int + access_token: String + refresh_token: String +} + +input ResetPasswordInput { + email: String! + new_password: String! + token: String! +} + +input RegisterInput { + name: String! + email: String! + password: String! + password_confirmation: String! +} + +input AddressInput { + first_name: String! + last_name: String! + area_id: ID! + info: String! + additional_info: String + mobile: String + lat: String + lng: String + isDefault: Boolean +} + +input UpdateProfile { + name: String + mobile: String +} + +input CartInput { + product_id: ID! + quantity: Int! +} + +input ReviewInput { + product_id: Int! + rating: Int! + review: String +} + +input WishlistInput { + product_id: Int! +} + +# Pagination information about the corresponding list of items. +type PageInfo { + # When paginating forwards, are there more items? + hasNextPage: Boolean! + + # When paginating backwards, are there more items? + hasPreviousPage: Boolean! + + # When paginating backwards, the cursor to continue. + startCursor: String + + # When paginating forwards, the cursor to continue. + endCursor: String + + # Total number of node in connection. + total: Int + + # Count of nodes in current request. + count: Int + + # Current page of request. + currentPage: Int + + # Last page in connection. + lastPage: Int +} + +# Allows ordering a list of records. +input OrderByClause { + # The column that is used for ordering. + field: String! + + # The direction that is used for ordering. + order: SortOrder! +} + +# Specify if you want to include or exclude trashed results from a query. +enum Trashed { + # Only return trashed results. + ONLY + + # Return both trashed and non-trashed results. + WITH + + # Only return non-trashed results. + WITHOUT +} diff --git a/pubspec.lock b/pubspec.lock index 0a17409..ec12cb4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -28,7 +28,7 @@ packages: name: artemis url: "https://pub.dartlang.org" source: hosted - version: "2.2.2" + version: "5.1.0" async: dependency: transitive description: From a321ee13538b39798d71ace8b6278b8a903c9f86 Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Fri, 18 Sep 2020 02:45:10 +0200 Subject: [PATCH 03/24] update dependencies --- example/pubspec.lock | 14 +++++++------- example/pubspec.yaml | 2 +- pubspec.lock | 14 +++++++------- pubspec.yaml | 7 +++++-- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 9499f2e..8542236 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -28,7 +28,7 @@ packages: name: artemis url: "https://pub.dartlang.org" source: hosted - version: "5.1.0" + version: "6.12.3-beta.1" async: dependency: transitive description: @@ -239,7 +239,7 @@ packages: name: gql url: "https://pub.dartlang.org" source: hosted - version: "0.12.3" + version: "0.12.4-alpha+1599667008836" gql_code_gen: dependency: transitive description: @@ -253,28 +253,28 @@ packages: name: gql_dedupe_link url: "https://pub.dartlang.org" source: hosted - version: "1.0.9" + version: "1.0.10" gql_exec: dependency: transitive description: name: gql_exec url: "https://pub.dartlang.org" source: hosted - version: "0.2.4" + version: "0.2.5-alpha+1599667008843" gql_http_link: dependency: transitive description: name: gql_http_link url: "https://pub.dartlang.org" source: hosted - version: "0.2.7" + version: "0.2.9" gql_link: dependency: transitive description: name: gql_link url: "https://pub.dartlang.org" source: hosted - version: "0.2.3" + version: "0.3.1-alpha+1599667008850" graphql: dependency: transitive description: @@ -484,7 +484,7 @@ packages: name: recase url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "3.0.0" rxdart: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index fccb731..785db54 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -27,7 +27,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - artemis: ^5.1.0 + artemis: ^6.12.3-beta.1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/pubspec.lock b/pubspec.lock index ec12cb4..7a08a86 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -28,7 +28,7 @@ packages: name: artemis url: "https://pub.dartlang.org" source: hosted - version: "5.1.0" + version: "6.12.3-beta.1" async: dependency: transitive description: @@ -260,7 +260,7 @@ packages: name: gql url: "https://pub.dartlang.org" source: hosted - version: "0.12.3" + version: "0.12.4-alpha+1599667008836" gql_code_gen: dependency: transitive description: @@ -274,28 +274,28 @@ packages: name: gql_dedupe_link url: "https://pub.dartlang.org" source: hosted - version: "1.0.9" + version: "1.0.10" gql_exec: dependency: transitive description: name: gql_exec url: "https://pub.dartlang.org" source: hosted - version: "0.2.4" + version: "0.2.5-alpha+1599667008843" gql_http_link: dependency: transitive description: name: gql_http_link url: "https://pub.dartlang.org" source: hosted - version: "0.2.7" + version: "0.2.9" gql_link: dependency: transitive description: name: gql_link url: "https://pub.dartlang.org" source: hosted - version: "0.2.3" + version: "0.3.1-alpha+1599667008850" graphql: dependency: transitive description: @@ -526,7 +526,7 @@ packages: name: recase url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "3.0.0" rxdart: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 22b8c98..35df331 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,12 +13,15 @@ dependencies: sdk: flutter json_serializable: ^3.2.3 equatable: ^1.0.2 - gql: ^0.12.0 + gql: '>=0.7.3 <1.0.0' # update according to DOCS https://pub.dev/packages/artemis/versions/6.12.3-beta.1#installation meta: ">=1.0.0 <2.0.0" # only if you have non nullable fields path_provider: ^1.5.1 graphql_flutter: ^3.1.0 analyzer: ^0.39.2+1 - artemis: ^5.1.0 + artemis: ^6.12.3-beta.1 + # add beta because have a Exception: Two classes were generated with the same name + # according to https://github.com/comigor/artemis/issues/194#issuecomment-670576452 + # use the latest beta version json_annotation: ^3.0.1 http: ^0.12.0+4 From 48b47aa6a1038eb8a361d6495b7c603994e0ce39 Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Sat, 19 Sep 2020 15:38:19 +0200 Subject: [PATCH 04/24] update queries and update api manger & update example --- example/lib/APIs.dart | 4 +- example/lib/apis/address_apis.dart | 11 +- example/lib/apis/auth_apis.dart | 2 +- example/lib/apis/cart_api.dart | 7 +- example/lib/apis/product_apis.dart | 33 +- example/lib/apis/user_apis.dart | 10 +- example/lib/main.dart | 47 +- example/pubspec.lock | 31 +- lib/apis/address_api_manager.dart | 23 +- lib/apis/auth_api_manager.dart | 22 +- lib/apis/cart_api_manager.dart | 10 +- lib/apis/general_api_manager.dart | 6 +- lib/apis/product_api_manager.dart | 32 +- lib/apis/user_api_manager.dart | 16 +- lib/common_models/common_models.dart | 130 +-- lib/generatedql/address/graphql_api.dart | 821 +---------------- lib/generatedql/address/graphql_api.g.dart | 228 ----- .../address/graphql_api.graphql.dart | 850 ++++++++++++++++++ .../address/graphql_api.graphql.g.dart | 265 ++++++ .../address_asset/graphql_api.dart | 175 +--- .../address_asset/graphql_api.g.dart | 64 -- .../address_asset/graphql_api.graphql.dart | 182 ++++ .../address_asset/graphql_api.graphql.g.dart | 71 ++ lib/generatedql/auth/graphql_api.dart | 511 +---------- lib/generatedql/auth/graphql_api.graphql.dart | 535 +++++++++++ ..._api.g.dart => graphql_api.graphql.g.dart} | 151 ++-- lib/generatedql/cart/graphql_api.dart | 616 +------------ lib/generatedql/cart/graphql_api.g.dart | 209 ----- lib/generatedql/cart/graphql_api.graphql.dart | 635 +++++++++++++ .../cart/graphql_api.graphql.g.dart | 243 +++++ lib/generatedql/categories/graphql_api.dart | 107 +-- lib/generatedql/categories/graphql_api.g.dart | 43 - .../categories/graphql_api.graphql.dart | 110 +++ .../categories/graphql_api.graphql.g.dart | 51 ++ lib/generatedql/general/graphql_api.dart | 272 +----- lib/generatedql/general/graphql_api.g.dart | 95 -- .../general/graphql_api.graphql.dart | 278 ++++++ .../general/graphql_api.graphql.g.dart | 110 +++ .../order_products/graphql_api.dart | 494 +--------- .../order_products/graphql_api.g.dart | 162 ---- .../order_products/graphql_api.graphql.dart | 528 +++++++++++ .../order_products/graphql_api.graphql.g.dart | 240 +++++ lib/generatedql/orders/graphql_api.dart | 244 +---- .../orders/graphql_api.graphql.dart | 255 ++++++ ..._api.g.dart => graphql_api.graphql.g.dart} | 87 +- lib/generatedql/products/graphql_api.dart | 456 +--------- lib/generatedql/products/graphql_api.g.dart | 155 ---- .../products/graphql_api.graphql.dart | 475 ++++++++++ .../products/graphql_api.graphql.g.dart | 186 ++++ lib/generatedql/ratings/graphql_api.dart | 299 +----- .../ratings/graphql_api.graphql.dart | 313 +++++++ ..._api.g.dart => graphql_api.graphql.g.dart} | 112 ++- .../related_product/graphql_api.dart | 286 +----- .../related_product/graphql_api.g.dart | 111 --- .../related_product/graphql_api.graphql.dart | 293 ++++++ .../graphql_api.graphql.g.dart | 134 +++ lib/generatedql/user/graphql_api.dart | 300 +------ lib/generatedql/user/graphql_api.g.dart | 98 -- lib/generatedql/user/graphql_api.graphql.dart | 313 +++++++ .../user/graphql_api.graphql.g.dart | 108 +++ lib/mmd_ecommerce.dart | 43 +- pubspec.lock | 29 +- 62 files changed, 6650 insertions(+), 6077 deletions(-) delete mode 100644 lib/generatedql/address/graphql_api.g.dart create mode 100644 lib/generatedql/address/graphql_api.graphql.dart create mode 100644 lib/generatedql/address/graphql_api.graphql.g.dart delete mode 100644 lib/generatedql/address_asset/graphql_api.g.dart create mode 100644 lib/generatedql/address_asset/graphql_api.graphql.dart create mode 100644 lib/generatedql/address_asset/graphql_api.graphql.g.dart create mode 100644 lib/generatedql/auth/graphql_api.graphql.dart rename lib/generatedql/auth/{graphql_api.g.dart => graphql_api.graphql.g.dart} (54%) delete mode 100644 lib/generatedql/cart/graphql_api.g.dart create mode 100644 lib/generatedql/cart/graphql_api.graphql.dart create mode 100644 lib/generatedql/cart/graphql_api.graphql.g.dart delete mode 100644 lib/generatedql/categories/graphql_api.g.dart create mode 100644 lib/generatedql/categories/graphql_api.graphql.dart create mode 100644 lib/generatedql/categories/graphql_api.graphql.g.dart delete mode 100644 lib/generatedql/general/graphql_api.g.dart create mode 100644 lib/generatedql/general/graphql_api.graphql.dart create mode 100644 lib/generatedql/general/graphql_api.graphql.g.dart delete mode 100644 lib/generatedql/order_products/graphql_api.g.dart create mode 100644 lib/generatedql/order_products/graphql_api.graphql.dart create mode 100644 lib/generatedql/order_products/graphql_api.graphql.g.dart create mode 100644 lib/generatedql/orders/graphql_api.graphql.dart rename lib/generatedql/orders/{graphql_api.g.dart => graphql_api.graphql.g.dart} (52%) delete mode 100644 lib/generatedql/products/graphql_api.g.dart create mode 100644 lib/generatedql/products/graphql_api.graphql.dart create mode 100644 lib/generatedql/products/graphql_api.graphql.g.dart create mode 100644 lib/generatedql/ratings/graphql_api.graphql.dart rename lib/generatedql/ratings/{graphql_api.g.dart => graphql_api.graphql.g.dart} (53%) delete mode 100644 lib/generatedql/related_product/graphql_api.g.dart create mode 100644 lib/generatedql/related_product/graphql_api.graphql.dart create mode 100644 lib/generatedql/related_product/graphql_api.graphql.g.dart delete mode 100644 lib/generatedql/user/graphql_api.g.dart create mode 100644 lib/generatedql/user/graphql_api.graphql.dart create mode 100644 lib/generatedql/user/graphql_api.graphql.g.dart diff --git a/example/lib/APIs.dart b/example/lib/APIs.dart index f89638d..4f0a71e 100644 --- a/example/lib/APIs.dart +++ b/example/lib/APIs.dart @@ -1,10 +1,10 @@ import 'package:mmd_ecommerce_fl_lib/mmd_ecommerce.dart'; callBrandsApi() { - GeneralApiManager.brandsApi((List brands) {}, () {}); + GeneralApiManager.brandsApi((List brands) {}, () {}); } sliderApi() async { await GeneralApiManager.sliderApi( - (List list) {}, (ApiErrorModel error) {}); + (List list) {}, (ApiErrorModel error) {}); } diff --git a/example/lib/apis/address_apis.dart b/example/lib/apis/address_apis.dart index 616e250..9cdd62a 100644 --- a/example/lib/apis/address_apis.dart +++ b/example/lib/apis/address_apis.dart @@ -1,8 +1,11 @@ import 'package:mmd_ecommerce_fl_lib/mmd_ecommerce.dart'; getAllAddress() async { - await AddressApiManager.addressesApi(5, 1, - (UserAddressPaginator addressPaginator) {}, (ApiErrorModel error) {}); + await AddressApiManager.addressesApi( + 5, + 1, + (GetAllAddress$Query$UserAddressPaginator addressPaginator) {}, + (ApiErrorModel error) {}); } createAddress() async { @@ -43,11 +46,11 @@ deleteAddress() async { getCitiesAsset() async { await AddressApiManager.citiesApi( - (List list) {}, (ApiErrorModel error) {}); + (List list) {}, (ApiErrorModel error) {}); } getAreaByIdAsset(String cityId) async { - await AddressApiManager.areaByIdApi(cityId, (List list) { + await AddressApiManager.areaByIdApi(cityId, (List list) { // }, (ApiErrorModel error) {}); } diff --git a/example/lib/apis/auth_apis.dart b/example/lib/apis/auth_apis.dart index 585ba7c..42c98ad 100644 --- a/example/lib/apis/auth_apis.dart +++ b/example/lib/apis/auth_apis.dart @@ -2,7 +2,7 @@ import 'package:mmd_ecommerce_fl_lib/mmd_ecommerce.dart'; callRegisterApi() { AuthApiManager.registerApi("mmd10", "rovox4067sri@ka0525.com", "123456", - (UserRegister user) {}, (ApiErrorModel error) {}); + (SignUp$Mutation$User register) {}, (ApiErrorModel error) {}); } callForgetPasswordApi(String email) { diff --git a/example/lib/apis/cart_api.dart b/example/lib/apis/cart_api.dart index 6afcd8d..39032d0 100644 --- a/example/lib/apis/cart_api.dart +++ b/example/lib/apis/cart_api.dart @@ -1,8 +1,8 @@ import 'package:mmd_ecommerce_fl_lib/mmd_ecommerce.dart'; getVoucherByCode() async { - await CartApiManager.voucherByCodeApi( - "2121", (Voucher voucher) {}, (ApiErrorModel error) {}); + await CartApiManager.voucherByCodeApi("2121", + (GetVoucherByCode$Query$Voucher voucher) {}, (ApiErrorModel error) {}); } shippingFeesApi() async { @@ -16,5 +16,6 @@ addToCard() async { } getCard() async { - await CartApiManager.cartDataApi((Cart cart) {}, (ApiErrorModel error) {}); + await CartApiManager.cartDataApi( + (GetCart$Query$Cart cart) {}, (ApiErrorModel error) {}); } diff --git a/example/lib/apis/product_apis.dart b/example/lib/apis/product_apis.dart index 05e0cb6..e7294e8 100644 --- a/example/lib/apis/product_apis.dart +++ b/example/lib/apis/product_apis.dart @@ -2,40 +2,47 @@ import 'package:mmd_ecommerce_fl_lib/mmd_ecommerce.dart'; categoriesApi() async { await GeneralApiManager.categoriesApi( - (List list) {}, (ApiErrorModel error) {}); + (List list) {}, (ApiErrorModel error) {}); } productApi() async { - await ProductApiManager.productsApi( - 10, 1, (ProductPaginatorModel item) {}, (ApiErrorModel error) {}); + await ProductApiManager.productsApi(10, 1, + (Products$Query$ProductPaginator item) {}, (ApiErrorModel error) {}); } productByCategoryIdApi() async { - await ProductApiManager.productByCategoryIdApi( - 10, 1, "1", (ProductPaginatorModel item) {}, (ApiErrorModel error) {}); + await ProductApiManager.productByCategoryIdApi(10, 1, "1", + (Products$Query$ProductPaginator item) {}, (ApiErrorModel error) {}); } newProductApi() async { await ProductApiManager.newProductApi( - 10, 1, (NewProductsModel item) {}, (ApiErrorModel error) {}); + 10, + 1, + SortOrder.desc, + ProductsOrderByColumn.id, + (OrderProducts$Query$ProductPaginator item) {}, + (ApiErrorModel error) {}); } getProductDetailsApi() async { await ProductApiManager.productDetailsApi( - "1", (ProductDetailsModel item) {}, (ApiErrorModel error) {}); + "1", + (Products$Query$ProductPaginator$Product item) {}, + (ApiErrorModel error) {}); } productByNameApi() async { - await ProductApiManager.productsByNameApi( - 10, 1, "ad", (ProductPaginatorModel item) {}, (ApiErrorModel error) {}); + await ProductApiManager.productsByNameApi(10, 1, "ad", + (Products$Query$ProductPaginator item) {}, (ApiErrorModel error) {}); } relatedProductByIdApi() async { - await ProductApiManager.relatedProductsByIdApi( - "1", (RelatedProductsModel item) {}, (ApiErrorModel error) {}); + await ProductApiManager.relatedProductsByIdApi("1", + (List items) {}, (ApiErrorModel error) {}); } getRatingsForProductApi() async { - await ProductApiManager.reviewsForProductApi( - 10, 1, "1", (RatingPaginatorModel item) {}, (ApiErrorModel error) {}); + await ProductApiManager.reviewsForProductApi(10, 1, "1", + (Ratings$Query$RatingPaginator item) {}, (ApiErrorModel error) {}); } diff --git a/example/lib/apis/user_apis.dart b/example/lib/apis/user_apis.dart index c73c060..0f3d7dd 100644 --- a/example/lib/apis/user_apis.dart +++ b/example/lib/apis/user_apis.dart @@ -6,7 +6,7 @@ callUpdateProfileApi(String name, String mobile) { } callMyProfileApi() { - UserApiManager.myProfileApi((UserMyProfile user) { + UserApiManager.myProfileApi((Profile$Query$User user) { // // @@ -21,11 +21,13 @@ callMyProfileApi() { callRefreshTokenApi(String refreshToken) { // var token = "def50200ff07466059c5bfbf0689902c06002bb5990e9c4ea0d8750c51e07b42ae1e86072c400ae807c7e06e9cac45864abb0c7a910ce9eb2ad629e495a73caca9fd32c3ee756580f62b883008ef03eb5dc91d48724ec4ffe595c4a72d832d8420eac5cced2a6e000ebd7bf2db21534970a8eca26121e760b7dfdda3652416d2c4f756f5eaa46605a7b6377238257f3b3fee3dff2763e227b2c8657fb46c549e76a6e825af62db5d5c77813eac04162a7118145890ec2182d4603dcce28e24d910a148dc50345ed199ab851e59f939c0d27205458fb823e949d1af4af461922c1bf75cccc8f680c740680e50d7242f50128f2cc1b184ae6a06da2f17ea7a7eb8203d37fff5aab86abaab64e9ea9d661985fd015cc393872bea47f633ce6baf91e4be0c439df984452c74359619b2e764bf4e7d073bfd120fca3b5bda6b3777a4f4fddb0b72590dacf9f7ea661c415b724da74ddc0113f48c6ff1ecd6de4567c6a077f0e6"; - UserApiManager.refreshTokenApi(refreshToken, - (AuthPayloadRefreshToken authPayload) {}, (ApiErrorModel error) {}); + UserApiManager.refreshTokenApi( + refreshToken, + (RefreshToken$Mutation$AuthPayload authPayload) {}, + (ApiErrorModel error) {}); } getAllOrdersApi() { UserApiManager.allOrdersApi( - 20, 1, (OrderPaginator orders) {}, (ApiErrorModel error) {}); + 20, 1, (Orders$Query$OrderPaginator orders) {}, (ApiErrorModel error) {}); } diff --git a/example/lib/main.dart b/example/lib/main.dart index 0a337da..f7a2cd8 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -38,7 +38,7 @@ class MyHomePage extends StatefulWidget { class _MyHomePageState extends State { var isLoading = false; - AuthPayloadLogin auth; + SignIn$Mutation$AuthPayload auth; var isError = false; TextEditingController emailController = TextEditingController(); @@ -60,20 +60,20 @@ class _MyHomePageState extends State { body: Center(child: isLoading ? getLoadingView() : getNormalView())); } - callApi() async { - setState(() { - isLoading = true; - }); - AuthApiManager.loginApi('test@mail.com', '123456789', "123", - (AuthPayloadLogin auth) { - setState(() { - this.isLoading = false; - this.auth = auth; - }); - }, () { - this.isError = true; - }); - } + // callApi() async { + // setState(() { + // isLoading = true; + // }); + // AuthApiManager.loginApi('test@mail.com', '123456789', "123", + // (SignIn$Mutation$AuthPayload auth) { + // setState(() { + // this.isLoading = false; + // this.auth = auth; + // }); + // }, () { + // this.isError = true; + // }); + // } Widget getLoadingView() { return CircularProgressIndicator(); @@ -85,14 +85,13 @@ class _MyHomePageState extends State { } else { return Column( children: [ - Text("Result Success \n${auth?.authPayload?.access_token}"), + Text("Result Success \n${auth?.accessToken}"), RaisedButton( onPressed: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => - MainSecond(auth.authPayload.refresh_token)), + builder: (context) => MainSecond(auth.refreshToken)), ); }, child: Text("Open Main Second"), @@ -230,11 +229,15 @@ class _MyHomePageState extends State { callLoginApi() async { await AuthApiManager.loginApi("test@mail.com", "1234567890", "123", - (AuthPayloadLogin authPayload) async { + (SignIn$Mutation$AuthPayload authPayload) async { auth = authPayload; MmdECommerceFlLib.submitTokeAndTokenType( - authPayload.authPayload.access_token, - authPayload.authPayload.token_type); - }, (ApiErrorModel error) {}); + authPayload.accessToken, authPayload.tokenType); + }, (ApiErrorModel error) { + print(error.errorCode); + print(error.errorMessage); + print(error.queryResult.exception); + print(error.queryResult.data); + }); } } diff --git a/example/pubspec.lock b/example/pubspec.lock index 8542236..7c9ca2f 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -49,7 +49,7 @@ packages: name: build url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.4.0" build_config: dependency: transitive description: @@ -140,7 +140,7 @@ packages: name: connectivity_macos url: "https://pub.dartlang.org" source: hosted - version: "0.1.0+4" + version: "0.1.0+5" connectivity_platform_interface: dependency: transitive description: @@ -189,7 +189,7 @@ packages: name: equatable url: "https://pub.dartlang.org" source: hosted - version: "1.2.4" + version: "1.2.5" fake_async: dependency: transitive description: @@ -197,6 +197,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0-nullsafety" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" file: dependency: transitive description: @@ -407,7 +414,7 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "1.6.14" + version: "1.6.16" path_provider_linux: dependency: transitive description: @@ -421,7 +428,7 @@ packages: name: path_provider_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.4+3" + version: "0.0.4+4" path_provider_platform_interface: dependency: transitive description: @@ -429,6 +436,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.3" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.2" pedantic: dependency: transitive description: @@ -581,6 +595,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.0.5" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.1" xdg_directories: dependency: transitive description: diff --git a/lib/apis/address_api_manager.dart b/lib/apis/address_api_manager.dart index 3dbd7c7..6bebb6c 100644 --- a/lib/apis/address_api_manager.dart +++ b/lib/apis/address_api_manager.dart @@ -2,6 +2,11 @@ import 'package:graphql_flutter/graphql_flutter.dart'; import 'package:mmd_ecommerce_fl_lib/apis/base/base_api_manager.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/address/graphql_api.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/address_asset/graphql_api.dart'; +import '../generatedql/address_asset/graphql_api.dart'; +import '../mmd_ecommerce.dart'; +import '../mmd_ecommerce.dart'; +import '../mmd_ecommerce.dart'; +import '../mmd_ecommerce.dart'; import 'error/api_error_helper.dart'; class AddressApiManager extends BaseApiManager { @@ -18,7 +23,7 @@ class AddressApiManager extends BaseApiManager { Function success, Function fail) async { var result = await BaseApiManager.mainClient().mutate(MutationOptions( - documentNode: CreateAddressQuery().document, + documentNode: CreateAddressMutation().document, variables: CreateAddressArguments( firstName: firstName, lastName: lastName, @@ -33,7 +38,7 @@ class AddressApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(CreateAddress.fromJson(result.data).createAddress); + success(CreateAddress$Mutation.fromJson(result.data).createAddress); } } @@ -51,7 +56,7 @@ class AddressApiManager extends BaseApiManager { Function success, Function fail) async { var result = await BaseApiManager.mainClient().mutate(MutationOptions( - documentNode: UpdateAddressQuery().document, + documentNode: UpdateAddressMutation().document, variables: UpdateAddressArguments( id: id, firstName: firstName, @@ -67,19 +72,19 @@ class AddressApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(UpdateAddress.fromJson(result.data).updateAddress); + success(UpdateAddress$Mutation.fromJson(result.data).updateAddress); } } static Future deleteAddressApi( String id, Function success, Function fail) async { var result = await BaseApiManager.mainClient().mutate(MutationOptions( - documentNode: DeleteAddressQuery().document, + documentNode: DeleteAddressMutation().document, variables: DeleteAddressArguments(id: id).toJson())); if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(DeleteAddress.fromJson(result.data).deleteAddress); + success(DeleteAddress$Mutation.fromJson(result.data).deleteAddress); } } @@ -91,7 +96,7 @@ class AddressApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(GetAllAddress.fromJson(result.data).addresses); + success(GetAllAddress$Query.fromJson(result.data).addresses); } } @@ -101,7 +106,7 @@ class AddressApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(Cities.fromJson(result.data).cities); + success(Cities$Query.fromJson(result.data).cities); } } @@ -113,7 +118,7 @@ class AddressApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(AreaByID.fromJson(result.data).areas); + success(AreaByID$Query.fromJson(result.data).areas); } } } diff --git a/lib/apis/auth_api_manager.dart b/lib/apis/auth_api_manager.dart index 57f46ab..69c3a2b 100644 --- a/lib/apis/auth_api_manager.dart +++ b/lib/apis/auth_api_manager.dart @@ -1,70 +1,70 @@ import 'package:graphql_flutter/graphql_flutter.dart'; import 'package:mmd_ecommerce_fl_lib/apis/base/base_api_manager.dart'; -import 'package:mmd_ecommerce_fl_lib/common_models/common_models.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/auth/graphql_api.dart'; +import '../mmd_ecommerce.dart'; import 'error/api_error_helper.dart'; class AuthApiManager extends BaseApiManager { static Future loginApi(String email, String password, String deviceToken, Function success, Function fail) async { var result = await BaseApiManager.mainClient().mutate(MutationOptions( - documentNode: SignInQuery().document, + documentNode: SignInMutation().document, variables: SignInArguments( email: email, password: password, deviceToken: deviceToken) .toJson())); if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(AuthPayloadLogin(SignIn.fromJson(result.data).login)); + success(SignIn$Mutation.fromJson(result.data).login); } } static Future registerApi(String name, String email, String password, Function success, Function fail) async { var result = await BaseApiManager.mainClient().mutate(MutationOptions( - documentNode: SignUpQuery().document, + documentNode: SignUpMutation().document, variables: SignUpArguments(name: name, email: email, password: password) .toJson())); if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(UserRegister(SignUp.fromJson(result.data).register)); + success(SignUp$Mutation.fromJson(result.data).register); } } static Future forgetPasswordApi( String email, Function success, Function fail) async { var result = await BaseApiManager.mainClient().mutate(MutationOptions( - documentNode: ForgetPasswordQuery().document, + documentNode: ForgetPasswordMutation().document, variables: ForgetPasswordArguments(email: email).toJson())); if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(ForgetPassword.fromJson(result.data).forgetPassword); + success(ForgetPassword$Mutation.fromJson(result.data).forgetPassword); } } static Future resetPasswordApi(String email, String newPassword, String codeOrToken, Function success, Function fail) async { var result = await BaseApiManager.mainClient().mutate(MutationOptions( - documentNode: ResetPasswordQuery().document, + documentNode: ResetPasswordMutation().document, variables: ResetPasswordArguments( email: email, newPassword: newPassword, token: codeOrToken) .toJson())); if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(ResetPassword.fromJson(result.data).resetPassword); + success(ResetPassword$Mutation.fromJson(result.data).resetPassword); } } static Future logoutApi(Function success, Function fail) async { var result = await BaseApiManager.mainClient() - .mutate(MutationOptions(documentNode: LogoutQuery().document)); + .mutate(MutationOptions(documentNode: LogoutMutation().document)); if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(Logout.fromJson(result.data).logout); + success(Logout$Mutation.fromJson(result.data).logout); } } } diff --git a/lib/apis/cart_api_manager.dart b/lib/apis/cart_api_manager.dart index 51d1c26..a2a58a6 100644 --- a/lib/apis/cart_api_manager.dart +++ b/lib/apis/cart_api_manager.dart @@ -7,13 +7,13 @@ class CartApiManager extends BaseApiManager { static Future addToCartApi( String productId, int quantity, Function success, Function fail) async { var result = await BaseApiManager.mainClient().query(QueryOptions( - documentNode: AddToCartQuery().document, + documentNode: AddToCartMutation().document, variables: AddToCartArguments(productId: productId, quantity: quantity) .toJson())); if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(AddToCart.fromJson(result.data).addToCart); + success(AddToCart$Mutation.fromJson(result.data).addToCart); } } @@ -24,7 +24,7 @@ class CartApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(GetCart.fromJson(result.data).cart); + success(GetCart$Query.fromJson(result.data).cart); } } @@ -36,7 +36,7 @@ class CartApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(GetVoucherByCode.fromJson(result.data).getVoucherByCode); + success(GetVoucherByCode$Query.fromJson(result.data).getVoucherByCode); } } @@ -50,7 +50,7 @@ class CartApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(ShippingFees.fromJson(result.data).shippingFees); + success(ShippingFees$Query.fromJson(result.data).shippingFees); } } } diff --git a/lib/apis/general_api_manager.dart b/lib/apis/general_api_manager.dart index 1eabb32..3d458eb 100644 --- a/lib/apis/general_api_manager.dart +++ b/lib/apis/general_api_manager.dart @@ -12,7 +12,7 @@ class GeneralApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(Brands.fromJson(result.data).brands); + success(Brands$Query.fromJson(result.data).brands); } } @@ -22,7 +22,7 @@ class GeneralApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(Sliders.fromJson(result.data).sliders); + success(Sliders$Query.fromJson(result.data).sliders); } } @@ -32,7 +32,7 @@ class GeneralApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(Categories.fromJson(result.data).categories); + success(Categories$Query.fromJson(result.data).categories); } } } diff --git a/lib/apis/product_api_manager.dart b/lib/apis/product_api_manager.dart index 1a4e82c..d3ffaae 100644 --- a/lib/apis/product_api_manager.dart +++ b/lib/apis/product_api_manager.dart @@ -4,6 +4,8 @@ import 'package:mmd_ecommerce_fl_lib/generatedql/order_products/graphql_api.dart import 'package:mmd_ecommerce_fl_lib/generatedql/related_product/graphql_api.dart'; import 'package:mmd_ecommerce_fl_lib/mmd_ecommerce.dart'; +import '../mmd_ecommerce.dart'; + class ProductApiManager extends BaseApiManager { static Future productsApi( int first, int page, Function success, Function fail) async { @@ -13,7 +15,7 @@ class ProductApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(ProductPaginatorModel(Products.fromJson(result.data).products)); + success(Products$Query.fromJson(result.data).products); } } @@ -27,7 +29,7 @@ class ProductApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(ProductPaginatorModel(Products.fromJson(result.data).products)); + success(Products$Query.fromJson(result.data).products); } } @@ -40,11 +42,7 @@ class ProductApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(ProductDetailsModel( - ProductPaginatorModel(Products.fromJson(result.data).products) - .productPaginator - .data - .first)); + success(Products$Query.fromJson(result.data).products.data.first); } } @@ -57,7 +55,7 @@ class ProductApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(ProductPaginatorModel(Products.fromJson(result.data).products)); + success(Products$Query.fromJson(result.data).products); } } @@ -69,8 +67,7 @@ class ProductApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(RelatedProductsModel( - RelatedProducts.fromJson(result.data).relatedProducts)); + success(RelatedProducts$Query.fromJson(result.data).relatedProducts); } } @@ -84,24 +81,29 @@ class ProductApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(RatingPaginatorModel(Ratings.fromJson(result.data).ratings)); + success(Ratings$Query.fromJson(result.data).ratings); } } static Future newProductApi( - int first, int page, Function success, Function fail) async { + int first, + int page, + SortOrder order, + ProductsOrderByColumn productsOrderByColumn, + Function success, + Function fail) async { var result = await BaseApiManager.mainClient().query(QueryOptions( documentNode: OrderProductsQuery().document, variables: OrderProductsArguments( first: first, page: page, - orderType: "DESC", - fieldOfOrder: "ID", + orderType: order, + fieldOfOrder: productsOrderByColumn, ).toJson())); if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(NewProductsModel(OrderProducts.fromJson(result.data).products)); + success(OrderProducts$Query.fromJson(result.data).products); } } } diff --git a/lib/apis/user_api_manager.dart b/lib/apis/user_api_manager.dart index a15b31b..27c9273 100644 --- a/lib/apis/user_api_manager.dart +++ b/lib/apis/user_api_manager.dart @@ -1,34 +1,34 @@ import 'package:graphql_flutter/graphql_flutter.dart'; import 'package:mmd_ecommerce_fl_lib/apis/base/base_api_manager.dart'; import 'package:mmd_ecommerce_fl_lib/apis/error/api_error_helper.dart'; -import 'package:mmd_ecommerce_fl_lib/common_models/common_models.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/orders/graphql_api.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/user/graphql_api.dart'; +import '../mmd_ecommerce.dart'; + class UserApiManager extends BaseApiManager { static Future refreshTokenApi( String token, Function success, Function fail) async { var result = await BaseApiManager.mainClient().mutate(MutationOptions( - documentNode: RefreshTokenQuery().document, + documentNode: RefreshTokenMutation().document, variables: RefreshTokenArguments(token: token).toJson())); if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(AuthPayloadRefreshToken( - RefreshToken.fromJson(result.data).refreshToken)); + success(RefreshToken$Mutation.fromJson(result.data).refreshToken); } } static Future updateProfileApi( String name, String mobile, Function success, Function fail) async { var result = await BaseApiManager.mainClient().mutate(MutationOptions( - documentNode: UpdateProfileQuery().document, + documentNode: UpdateProfileMutation().document, variables: UpdateProfileArguments(name: name, mobile: mobile).toJson())); if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(UpdateProfile.fromJson(result.data).updateProfile); + success(UpdateProfile$Mutation.fromJson(result.data).updateProfile); } } @@ -39,7 +39,7 @@ class UserApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(UserMyProfile(Profile.fromJson(result.data).profile)); + success(Profile$Query.fromJson(result.data).profile); } } @@ -51,7 +51,7 @@ class UserApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(Orders.fromJson(result.data).orders); + success(Orders$Query.fromJson(result.data).orders); } } } diff --git a/lib/common_models/common_models.dart b/lib/common_models/common_models.dart index 5081970..2b19e8e 100644 --- a/lib/common_models/common_models.dart +++ b/lib/common_models/common_models.dart @@ -1,91 +1,91 @@ -import 'package:mmd_ecommerce_fl_lib/generatedql/auth/graphql_api.dart' as A; -import 'package:mmd_ecommerce_fl_lib/generatedql/user/graphql_api.dart' as U; -import 'package:mmd_ecommerce_fl_lib/generatedql/products/graphql_api.dart' - as P; -import 'package:mmd_ecommerce_fl_lib/generatedql/cart/graphql_api.dart' as C; -import 'package:mmd_ecommerce_fl_lib/generatedql/categories/graphql_api.dart' - as CT; -import 'package:mmd_ecommerce_fl_lib/generatedql/ratings/graphql_api.dart' as R; -import 'package:mmd_ecommerce_fl_lib/generatedql/related_product/graphql_api.dart' - as RELATED; -import 'package:mmd_ecommerce_fl_lib/generatedql/order_products/graphql_api.dart' - as O; +// import 'package:mmd_ecommerce_fl_lib/generatedql/auth/graphql_api.dart' as A; +// import 'package:mmd_ecommerce_fl_lib/generatedql/user/graphql_api.dart' as U; +// import 'package:mmd_ecommerce_fl_lib/generatedql/products/graphql_api.dart' +// as P; +// import 'package:mmd_ecommerce_fl_lib/generatedql/cart/graphql_api.dart' as C; +// import 'package:mmd_ecommerce_fl_lib/generatedql/categories/graphql_api.dart' +// as CT; +// import 'package:mmd_ecommerce_fl_lib/generatedql/ratings/graphql_api.dart' as R; +// import 'package:mmd_ecommerce_fl_lib/generatedql/related_product/graphql_api.dart' +// as RELATED; +// import 'package:mmd_ecommerce_fl_lib/generatedql/order_products/graphql_api.dart' +// as O; -/// this class to solve conflicts between the same model names of the graphql api -class UserMyProfile { - final U.User user; +// /// this class to solve conflicts between the same model names of the graphql api +// class UserMyProfile { +// final U.User user; - UserMyProfile(this.user); -} +// UserMyProfile(this.user); +// } -class UserRegister { - final A.User user; +// class UserRegister { +// final A.User user; - UserRegister(this.user); -} +// UserRegister(this.user); +// } -class AuthPayloadLogin { - final A.AuthPayload authPayload; +// class AuthPayloadLogin { +// final A.AuthPayload authPayload; - AuthPayloadLogin(this.authPayload); -} +// AuthPayloadLogin(this.authPayload); +// } -class AuthPayloadRefreshToken { - final U.AuthPayload authPayload; +// class AuthPayloadRefreshToken { +// final U.AuthPayload authPayload; - AuthPayloadRefreshToken(this.authPayload); -} +// AuthPayloadRefreshToken(this.authPayload); +// } -class MediaCard { - final C.Media media; +// class MediaCard { +// final C.Media media; - MediaCard(this.media); -} +// MediaCard(this.media); +// } -class MediaProduct { - final P.Media media; +// class MediaProduct { +// final P.Media media; - MediaProduct(this.media); -} +// MediaProduct(this.media); +// } -class MediaCategory { - final CT.Media media; +// class MediaCategory { +// final CT.Media media; - MediaCategory(this.media); -} +// MediaCategory(this.media); +// } -class CategoryModel { - final CT.Category category; +// class CategoryModel { +// final CT.Category category; - CategoryModel(this.category); -} +// CategoryModel(this.category); +// } -class RatingPaginatorModel { - final R.RatingPaginator ratingPaginator; +// class RatingPaginatorModel { +// final R.RatingPaginator ratingPaginator; - RatingPaginatorModel(this.ratingPaginator); -} +// RatingPaginatorModel(this.ratingPaginator); +// } -class ProductPaginatorModel { - final P.ProductPaginator productPaginator; +// class ProductPaginatorModel { +// final P.ProductPaginator productPaginator; - ProductPaginatorModel(this.productPaginator); -} +// ProductPaginatorModel(this.productPaginator); +// } -class ProductDetailsModel { - final P.Product productDetails; +// class ProductDetailsModel { +// final P.Product productDetails; - ProductDetailsModel(this.productDetails); -} +// ProductDetailsModel(this.productDetails); +// } -class RelatedProductsModel { - final List products; +// class RelatedProductsModel { +// final List products; - RelatedProductsModel(this.products); -} +// RelatedProductsModel(this.products); +// } -class NewProductsModel { - final O.ProductPaginator productPaginator; +// class NewProductsModel { +// final O.ProductPaginator productPaginator; - NewProductsModel(this.productPaginator); -} +// NewProductsModel(this.productPaginator); +// } diff --git a/lib/generatedql/address/graphql_api.dart b/lib/generatedql/address/graphql_api.dart index 8c1d34b..196c5cd 100644 --- a/lib/generatedql/address/graphql_api.dart +++ b/lib/generatedql/address/graphql_api.dart @@ -1,821 +1,2 @@ // GENERATED CODE - DO NOT MODIFY BY HAND - -import 'package:artemis/artemis.dart'; -import 'package:json_annotation/json_annotation.dart'; -import 'package:equatable/equatable.dart'; -import 'package:gql/ast.dart'; -part 'graphql_api.g.dart'; - -@JsonSerializable(explicitToJson: true) -class CreateAddress with EquatableMixin { - CreateAddress(); - - factory CreateAddress.fromJson(Map json) => - _$CreateAddressFromJson(json); - - bool createAddress; - - @override - List get props => [createAddress]; - Map toJson() => _$CreateAddressToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class CreateAddressArguments extends JsonSerializable with EquatableMixin { - CreateAddressArguments( - {this.firstName, - this.lastName, - this.areaId, - this.info, - this.additionalInfo, - this.mobile, - this.lat, - this.lng, - this.isDefault}); - - factory CreateAddressArguments.fromJson(Map json) => - _$CreateAddressArgumentsFromJson(json); - - final String firstName; - - final String lastName; - - final String areaId; - - final String info; - - final String additionalInfo; - - final String mobile; - - final String lat; - - final String lng; - - final bool isDefault; - - @override - List get props => [ - firstName, - lastName, - areaId, - info, - additionalInfo, - mobile, - lat, - lng, - isDefault - ]; - Map toJson() => _$CreateAddressArgumentsToJson(this); -} - -class CreateAddressQuery - extends GraphQLQuery { - CreateAddressQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.mutation, - name: NameNode(value: 'CreateAddress'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'firstName')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'lastName')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'areaId')), - type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'info')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'additionalInfo')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'mobile')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'lat')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'lng')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'isDefault')), - type: NamedTypeNode( - name: NameNode(value: 'Boolean'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'createAddress'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'input'), - value: ObjectValueNode(fields: [ - ObjectFieldNode( - name: NameNode(value: 'first_name'), - value: - VariableNode(name: NameNode(value: 'firstName'))), - ObjectFieldNode( - name: NameNode(value: 'last_name'), - value: - VariableNode(name: NameNode(value: 'lastName'))), - ObjectFieldNode( - name: NameNode(value: 'area_id'), - value: VariableNode(name: NameNode(value: 'areaId'))), - ObjectFieldNode( - name: NameNode(value: 'info'), - value: VariableNode(name: NameNode(value: 'info'))), - ObjectFieldNode( - name: NameNode(value: 'additional_info'), - value: VariableNode( - name: NameNode(value: 'additionalInfo'))), - ObjectFieldNode( - name: NameNode(value: 'mobile'), - value: VariableNode(name: NameNode(value: 'mobile'))), - ObjectFieldNode( - name: NameNode(value: 'lat'), - value: VariableNode(name: NameNode(value: 'lat'))), - ObjectFieldNode( - name: NameNode(value: 'lng'), - value: VariableNode(name: NameNode(value: 'lng'))), - ObjectFieldNode( - name: NameNode(value: 'isDefault'), - value: - VariableNode(name: NameNode(value: 'isDefault'))) - ])) - ], - directives: [], - selectionSet: null) - ])) - ]); - - @override - final String operationName = 'CreateAddress'; - - @override - final CreateAddressArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - CreateAddress parse(Map json) => - CreateAddress.fromJson(json); -} - -@JsonSerializable(explicitToJson: true) -class DeleteAddress with EquatableMixin { - DeleteAddress(); - - factory DeleteAddress.fromJson(Map json) => - _$DeleteAddressFromJson(json); - - bool deleteAddress; - - @override - List get props => [deleteAddress]; - Map toJson() => _$DeleteAddressToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class DeleteAddressArguments extends JsonSerializable with EquatableMixin { - DeleteAddressArguments({this.id}); - - factory DeleteAddressArguments.fromJson(Map json) => - _$DeleteAddressArgumentsFromJson(json); - - final String id; - - @override - List get props => [id]; - Map toJson() => _$DeleteAddressArgumentsToJson(this); -} - -class DeleteAddressQuery - extends GraphQLQuery { - DeleteAddressQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.mutation, - name: NameNode(value: 'DeleteAddress'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'id')), - type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'deleteAddress'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'id'), - value: VariableNode(name: NameNode(value: 'id'))) - ], - directives: [], - selectionSet: null) - ])) - ]); - - @override - final String operationName = 'DeleteAddress'; - - @override - final DeleteAddressArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - DeleteAddress parse(Map json) => - DeleteAddress.fromJson(json); -} - -mixin PagingMixin { - int count; - int currentPage; - int firstItem; - int lastItem; - bool hasMorePages; - int lastPage; - int perPage; - int total; -} - -@JsonSerializable(explicitToJson: true) -class GetAllAddress with EquatableMixin { - GetAllAddress(); - - factory GetAllAddress.fromJson(Map json) => - _$GetAllAddressFromJson(json); - - UserAddressPaginator addresses; - - @override - List get props => [addresses]; - Map toJson() => _$GetAllAddressToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class UserAddressPaginator with EquatableMixin { - UserAddressPaginator(); - - factory UserAddressPaginator.fromJson(Map json) => - _$UserAddressPaginatorFromJson(json); - - PaginatorInfo paginatorInfo; - - List data; - - @override - List get props => [paginatorInfo, data]; - Map toJson() => _$UserAddressPaginatorToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class PaginatorInfo with EquatableMixin, PagingMixin { - PaginatorInfo(); - - factory PaginatorInfo.fromJson(Map json) => - _$PaginatorInfoFromJson(json); - - @override - List get props => [ - count, - currentPage, - firstItem, - lastItem, - hasMorePages, - lastPage, - perPage, - total - ]; - Map toJson() => _$PaginatorInfoToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class UserAddress with EquatableMixin { - UserAddress(); - - factory UserAddress.fromJson(Map json) => - _$UserAddressFromJson(json); - - String id; - - String first_name; - - String last_name; - - Area area; - - String info; - - String additional_info; - - String mobile; - - String lat; - - String lng; - - bool isDefault; - - @override - List get props => [ - id, - first_name, - last_name, - area, - info, - additional_info, - mobile, - lat, - lng, - isDefault - ]; - Map toJson() => _$UserAddressToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Area with EquatableMixin { - Area(); - - factory Area.fromJson(Map json) => _$AreaFromJson(json); - - String name; - - City city; - - @override - List get props => [name, city]; - Map toJson() => _$AreaToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class City with EquatableMixin { - City(); - - factory City.fromJson(Map json) => _$CityFromJson(json); - - String name; - - @override - List get props => [name]; - Map toJson() => _$CityToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GetAllAddressArguments extends JsonSerializable with EquatableMixin { - GetAllAddressArguments({this.first, this.page}); - - factory GetAllAddressArguments.fromJson(Map json) => - _$GetAllAddressArgumentsFromJson(json); - - final int first; - - final int page; - - @override - List get props => [first, page]; - Map toJson() => _$GetAllAddressArgumentsToJson(this); -} - -class GetAllAddressQuery - extends GraphQLQuery { - GetAllAddressQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'GetAllAddress'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'first')), - type: - NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'page')), - type: - NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'addresses'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'first'), - value: VariableNode(name: NameNode(value: 'first'))), - ArgumentNode( - name: NameNode(value: 'page'), - value: VariableNode(name: NameNode(value: 'page'))) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'paginatorInfo'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FragmentSpreadNode( - name: NameNode(value: 'Paging'), directives: []) - ])), - FieldNode( - name: NameNode(value: 'data'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'first_name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'last_name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'area'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'city'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])), - FieldNode( - name: NameNode(value: 'info'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'additional_info'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'mobile'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'lat'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'lng'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'isDefault'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ])), - FragmentDefinitionNode( - name: NameNode(value: 'Paging'), - typeCondition: TypeConditionNode( - on: NamedTypeNode( - name: NameNode(value: 'PaginatorInfo'), isNonNull: false)), - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'count'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'currentPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'firstItem'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'lastItem'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'hasMorePages'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'lastPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'perPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'total'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ]); - - @override - final String operationName = 'GetAllAddress'; - - @override - final GetAllAddressArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - GetAllAddress parse(Map json) => - GetAllAddress.fromJson(json); -} - -@JsonSerializable(explicitToJson: true) -class UpdateAddress with EquatableMixin { - UpdateAddress(); - - factory UpdateAddress.fromJson(Map json) => - _$UpdateAddressFromJson(json); - - bool updateAddress; - - @override - List get props => [updateAddress]; - Map toJson() => _$UpdateAddressToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class UpdateAddressArguments extends JsonSerializable with EquatableMixin { - UpdateAddressArguments( - {this.id, - this.firstName, - this.lastName, - this.areaId, - this.info, - this.additionalInfo, - this.mobile, - this.lat, - this.lng, - this.isDefault}); - - factory UpdateAddressArguments.fromJson(Map json) => - _$UpdateAddressArgumentsFromJson(json); - - final String id; - - final String firstName; - - final String lastName; - - final String areaId; - - final String info; - - final String additionalInfo; - - final String mobile; - - final String lat; - - final String lng; - - final bool isDefault; - - @override - List get props => [ - id, - firstName, - lastName, - areaId, - info, - additionalInfo, - mobile, - lat, - lng, - isDefault - ]; - Map toJson() => _$UpdateAddressArgumentsToJson(this); -} - -class UpdateAddressQuery - extends GraphQLQuery { - UpdateAddressQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.mutation, - name: NameNode(value: 'UpdateAddress'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'id')), - type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'firstName')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'lastName')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'areaId')), - type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'info')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'additionalInfo')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'mobile')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'lat')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'lng')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'isDefault')), - type: NamedTypeNode( - name: NameNode(value: 'Boolean'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'updateAddress'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'id'), - value: VariableNode(name: NameNode(value: 'id'))), - ArgumentNode( - name: NameNode(value: 'input'), - value: ObjectValueNode(fields: [ - ObjectFieldNode( - name: NameNode(value: 'first_name'), - value: - VariableNode(name: NameNode(value: 'firstName'))), - ObjectFieldNode( - name: NameNode(value: 'last_name'), - value: - VariableNode(name: NameNode(value: 'lastName'))), - ObjectFieldNode( - name: NameNode(value: 'area_id'), - value: VariableNode(name: NameNode(value: 'areaId'))), - ObjectFieldNode( - name: NameNode(value: 'info'), - value: VariableNode(name: NameNode(value: 'info'))), - ObjectFieldNode( - name: NameNode(value: 'additional_info'), - value: VariableNode( - name: NameNode(value: 'additionalInfo'))), - ObjectFieldNode( - name: NameNode(value: 'mobile'), - value: VariableNode(name: NameNode(value: 'mobile'))), - ObjectFieldNode( - name: NameNode(value: 'lat'), - value: VariableNode(name: NameNode(value: 'lat'))), - ObjectFieldNode( - name: NameNode(value: 'lng'), - value: VariableNode(name: NameNode(value: 'lng'))), - ObjectFieldNode( - name: NameNode(value: 'isDefault'), - value: - VariableNode(name: NameNode(value: 'isDefault'))) - ])) - ], - directives: [], - selectionSet: null) - ])) - ]); - - @override - final String operationName = 'UpdateAddress'; - - @override - final UpdateAddressArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - UpdateAddress parse(Map json) => - UpdateAddress.fromJson(json); -} +export 'graphql_api.graphql.dart'; diff --git a/lib/generatedql/address/graphql_api.g.dart b/lib/generatedql/address/graphql_api.g.dart deleted file mode 100644 index 793724e..0000000 --- a/lib/generatedql/address/graphql_api.g.dart +++ /dev/null @@ -1,228 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'graphql_api.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -CreateAddress _$CreateAddressFromJson(Map json) { - return CreateAddress()..createAddress = json['createAddress'] as bool; -} - -Map _$CreateAddressToJson(CreateAddress instance) => - { - 'createAddress': instance.createAddress, - }; - -CreateAddressArguments _$CreateAddressArgumentsFromJson( - Map json) { - return CreateAddressArguments( - firstName: json['firstName'] as String, - lastName: json['lastName'] as String, - areaId: json['areaId'] as String, - info: json['info'] as String, - additionalInfo: json['additionalInfo'] as String, - mobile: json['mobile'] as String, - lat: json['lat'] as String, - lng: json['lng'] as String, - isDefault: json['isDefault'] as bool, - ); -} - -Map _$CreateAddressArgumentsToJson( - CreateAddressArguments instance) => - { - 'firstName': instance.firstName, - 'lastName': instance.lastName, - 'areaId': instance.areaId, - 'info': instance.info, - 'additionalInfo': instance.additionalInfo, - 'mobile': instance.mobile, - 'lat': instance.lat, - 'lng': instance.lng, - 'isDefault': instance.isDefault, - }; - -DeleteAddress _$DeleteAddressFromJson(Map json) { - return DeleteAddress()..deleteAddress = json['deleteAddress'] as bool; -} - -Map _$DeleteAddressToJson(DeleteAddress instance) => - { - 'deleteAddress': instance.deleteAddress, - }; - -DeleteAddressArguments _$DeleteAddressArgumentsFromJson( - Map json) { - return DeleteAddressArguments( - id: json['id'] as String, - ); -} - -Map _$DeleteAddressArgumentsToJson( - DeleteAddressArguments instance) => - { - 'id': instance.id, - }; - -GetAllAddress _$GetAllAddressFromJson(Map json) { - return GetAllAddress() - ..addresses = json['addresses'] == null - ? null - : UserAddressPaginator.fromJson( - json['addresses'] as Map); -} - -Map _$GetAllAddressToJson(GetAllAddress instance) => - { - 'addresses': instance.addresses?.toJson(), - }; - -UserAddressPaginator _$UserAddressPaginatorFromJson(Map json) { - return UserAddressPaginator() - ..paginatorInfo = json['paginatorInfo'] == null - ? null - : PaginatorInfo.fromJson(json['paginatorInfo'] as Map) - ..data = (json['data'] as List) - ?.map((e) => - e == null ? null : UserAddress.fromJson(e as Map)) - ?.toList(); -} - -Map _$UserAddressPaginatorToJson( - UserAddressPaginator instance) => - { - 'paginatorInfo': instance.paginatorInfo?.toJson(), - 'data': instance.data?.map((e) => e?.toJson())?.toList(), - }; - -PaginatorInfo _$PaginatorInfoFromJson(Map json) { - return PaginatorInfo() - ..count = json['count'] as int - ..currentPage = json['currentPage'] as int - ..firstItem = json['firstItem'] as int - ..lastItem = json['lastItem'] as int - ..hasMorePages = json['hasMorePages'] as bool - ..lastPage = json['lastPage'] as int - ..perPage = json['perPage'] as int - ..total = json['total'] as int; -} - -Map _$PaginatorInfoToJson(PaginatorInfo instance) => - { - 'count': instance.count, - 'currentPage': instance.currentPage, - 'firstItem': instance.firstItem, - 'lastItem': instance.lastItem, - 'hasMorePages': instance.hasMorePages, - 'lastPage': instance.lastPage, - 'perPage': instance.perPage, - 'total': instance.total, - }; - -UserAddress _$UserAddressFromJson(Map json) { - return UserAddress() - ..id = json['id'] as String - ..first_name = json['first_name'] as String - ..last_name = json['last_name'] as String - ..area = json['area'] == null - ? null - : Area.fromJson(json['area'] as Map) - ..info = json['info'] as String - ..additional_info = json['additional_info'] as String - ..mobile = json['mobile'] as String - ..lat = json['lat'] as String - ..lng = json['lng'] as String - ..isDefault = json['isDefault'] as bool; -} - -Map _$UserAddressToJson(UserAddress instance) => - { - 'id': instance.id, - 'first_name': instance.first_name, - 'last_name': instance.last_name, - 'area': instance.area?.toJson(), - 'info': instance.info, - 'additional_info': instance.additional_info, - 'mobile': instance.mobile, - 'lat': instance.lat, - 'lng': instance.lng, - 'isDefault': instance.isDefault, - }; - -Area _$AreaFromJson(Map json) { - return Area() - ..name = json['name'] as String - ..city = json['city'] == null - ? null - : City.fromJson(json['city'] as Map); -} - -Map _$AreaToJson(Area instance) => { - 'name': instance.name, - 'city': instance.city?.toJson(), - }; - -City _$CityFromJson(Map json) { - return City()..name = json['name'] as String; -} - -Map _$CityToJson(City instance) => { - 'name': instance.name, - }; - -GetAllAddressArguments _$GetAllAddressArgumentsFromJson( - Map json) { - return GetAllAddressArguments( - first: json['first'] as int, - page: json['page'] as int, - ); -} - -Map _$GetAllAddressArgumentsToJson( - GetAllAddressArguments instance) => - { - 'first': instance.first, - 'page': instance.page, - }; - -UpdateAddress _$UpdateAddressFromJson(Map json) { - return UpdateAddress()..updateAddress = json['updateAddress'] as bool; -} - -Map _$UpdateAddressToJson(UpdateAddress instance) => - { - 'updateAddress': instance.updateAddress, - }; - -UpdateAddressArguments _$UpdateAddressArgumentsFromJson( - Map json) { - return UpdateAddressArguments( - id: json['id'] as String, - firstName: json['firstName'] as String, - lastName: json['lastName'] as String, - areaId: json['areaId'] as String, - info: json['info'] as String, - additionalInfo: json['additionalInfo'] as String, - mobile: json['mobile'] as String, - lat: json['lat'] as String, - lng: json['lng'] as String, - isDefault: json['isDefault'] as bool, - ); -} - -Map _$UpdateAddressArgumentsToJson( - UpdateAddressArguments instance) => - { - 'id': instance.id, - 'firstName': instance.firstName, - 'lastName': instance.lastName, - 'areaId': instance.areaId, - 'info': instance.info, - 'additionalInfo': instance.additionalInfo, - 'mobile': instance.mobile, - 'lat': instance.lat, - 'lng': instance.lng, - 'isDefault': instance.isDefault, - }; diff --git a/lib/generatedql/address/graphql_api.graphql.dart b/lib/generatedql/address/graphql_api.graphql.dart new file mode 100644 index 0000000..48df019 --- /dev/null +++ b/lib/generatedql/address/graphql_api.graphql.dart @@ -0,0 +1,850 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +import 'package:meta/meta.dart'; +import 'package:artemis/artemis.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:equatable/equatable.dart'; +import 'package:gql/ast.dart'; +part 'graphql_api.graphql.g.dart'; + +mixin PagingMixin { + int count; + int currentPage; + int firstItem; + int lastItem; + bool hasMorePages; + int lastPage; + int perPage; + int total; +} + +@JsonSerializable(explicitToJson: true) +class CreateAddress$Mutation with EquatableMixin { + CreateAddress$Mutation(); + + factory CreateAddress$Mutation.fromJson(Map json) => + _$CreateAddress$MutationFromJson(json); + + bool createAddress; + + @override + List get props => [createAddress]; + Map toJson() => _$CreateAddress$MutationToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class DeleteAddress$Mutation with EquatableMixin { + DeleteAddress$Mutation(); + + factory DeleteAddress$Mutation.fromJson(Map json) => + _$DeleteAddress$MutationFromJson(json); + + bool deleteAddress; + + @override + List get props => [deleteAddress]; + Map toJson() => _$DeleteAddress$MutationToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GetAllAddress$Query$UserAddressPaginator$PaginatorInfo + with EquatableMixin, PagingMixin { + GetAllAddress$Query$UserAddressPaginator$PaginatorInfo(); + + factory GetAllAddress$Query$UserAddressPaginator$PaginatorInfo.fromJson( + Map json) => + _$GetAllAddress$Query$UserAddressPaginator$PaginatorInfoFromJson(json); + + @override + List get props => [ + count, + currentPage, + firstItem, + lastItem, + hasMorePages, + lastPage, + perPage, + total + ]; + Map toJson() => + _$GetAllAddress$Query$UserAddressPaginator$PaginatorInfoToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GetAllAddress$Query$UserAddressPaginator$UserAddress$Area$City + with EquatableMixin { + GetAllAddress$Query$UserAddressPaginator$UserAddress$Area$City(); + + factory GetAllAddress$Query$UserAddressPaginator$UserAddress$Area$City.fromJson( + Map json) => + _$GetAllAddress$Query$UserAddressPaginator$UserAddress$Area$CityFromJson( + json); + + String name; + + @override + List get props => [name]; + Map toJson() => + _$GetAllAddress$Query$UserAddressPaginator$UserAddress$Area$CityToJson( + this); +} + +@JsonSerializable(explicitToJson: true) +class GetAllAddress$Query$UserAddressPaginator$UserAddress$Area + with EquatableMixin { + GetAllAddress$Query$UserAddressPaginator$UserAddress$Area(); + + factory GetAllAddress$Query$UserAddressPaginator$UserAddress$Area.fromJson( + Map json) => + _$GetAllAddress$Query$UserAddressPaginator$UserAddress$AreaFromJson(json); + + String name; + + GetAllAddress$Query$UserAddressPaginator$UserAddress$Area$City city; + + @override + List get props => [name, city]; + Map toJson() => + _$GetAllAddress$Query$UserAddressPaginator$UserAddress$AreaToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GetAllAddress$Query$UserAddressPaginator$UserAddress with EquatableMixin { + GetAllAddress$Query$UserAddressPaginator$UserAddress(); + + factory GetAllAddress$Query$UserAddressPaginator$UserAddress.fromJson( + Map json) => + _$GetAllAddress$Query$UserAddressPaginator$UserAddressFromJson(json); + + String id; + + @JsonKey(name: 'first_name') + String firstName; + + @JsonKey(name: 'last_name') + String lastName; + + GetAllAddress$Query$UserAddressPaginator$UserAddress$Area area; + + String info; + + @JsonKey(name: 'additional_info') + String additionalInfo; + + String mobile; + + String lat; + + String lng; + + bool isDefault; + + @override + List get props => [ + id, + firstName, + lastName, + area, + info, + additionalInfo, + mobile, + lat, + lng, + isDefault + ]; + Map toJson() => + _$GetAllAddress$Query$UserAddressPaginator$UserAddressToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GetAllAddress$Query$UserAddressPaginator with EquatableMixin { + GetAllAddress$Query$UserAddressPaginator(); + + factory GetAllAddress$Query$UserAddressPaginator.fromJson( + Map json) => + _$GetAllAddress$Query$UserAddressPaginatorFromJson(json); + + GetAllAddress$Query$UserAddressPaginator$PaginatorInfo paginatorInfo; + + List data; + + @override + List get props => [paginatorInfo, data]; + Map toJson() => + _$GetAllAddress$Query$UserAddressPaginatorToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GetAllAddress$Query with EquatableMixin { + GetAllAddress$Query(); + + factory GetAllAddress$Query.fromJson(Map json) => + _$GetAllAddress$QueryFromJson(json); + + GetAllAddress$Query$UserAddressPaginator addresses; + + @override + List get props => [addresses]; + Map toJson() => _$GetAllAddress$QueryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class UpdateAddress$Mutation with EquatableMixin { + UpdateAddress$Mutation(); + + factory UpdateAddress$Mutation.fromJson(Map json) => + _$UpdateAddress$MutationFromJson(json); + + bool updateAddress; + + @override + List get props => [updateAddress]; + Map toJson() => _$UpdateAddress$MutationToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class CreateAddressArguments extends JsonSerializable with EquatableMixin { + CreateAddressArguments( + {@required this.firstName, + @required this.lastName, + @required this.areaId, + @required this.info, + @required this.additionalInfo, + @required this.mobile, + @required this.lat, + @required this.lng, + @required this.isDefault}); + + @override + factory CreateAddressArguments.fromJson(Map json) => + _$CreateAddressArgumentsFromJson(json); + + final String firstName; + + final String lastName; + + final String areaId; + + final String info; + + final String additionalInfo; + + final String mobile; + + final String lat; + + final String lng; + + final bool isDefault; + + @override + List get props => [ + firstName, + lastName, + areaId, + info, + additionalInfo, + mobile, + lat, + lng, + isDefault + ]; + @override + Map toJson() => _$CreateAddressArgumentsToJson(this); +} + +class CreateAddressMutation + extends GraphQLQuery { + CreateAddressMutation({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'CreateAddress'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'firstName')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'lastName')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'areaId')), + type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'info')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'additionalInfo')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'mobile')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'lat')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'lng')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'isDefault')), + type: NamedTypeNode( + name: NameNode(value: 'Boolean'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'createAddress'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'input'), + value: ObjectValueNode(fields: [ + ObjectFieldNode( + name: NameNode(value: 'first_name'), + value: + VariableNode(name: NameNode(value: 'firstName'))), + ObjectFieldNode( + name: NameNode(value: 'last_name'), + value: + VariableNode(name: NameNode(value: 'lastName'))), + ObjectFieldNode( + name: NameNode(value: 'area_id'), + value: VariableNode(name: NameNode(value: 'areaId'))), + ObjectFieldNode( + name: NameNode(value: 'info'), + value: VariableNode(name: NameNode(value: 'info'))), + ObjectFieldNode( + name: NameNode(value: 'additional_info'), + value: VariableNode( + name: NameNode(value: 'additionalInfo'))), + ObjectFieldNode( + name: NameNode(value: 'mobile'), + value: VariableNode(name: NameNode(value: 'mobile'))), + ObjectFieldNode( + name: NameNode(value: 'lat'), + value: VariableNode(name: NameNode(value: 'lat'))), + ObjectFieldNode( + name: NameNode(value: 'lng'), + value: VariableNode(name: NameNode(value: 'lng'))), + ObjectFieldNode( + name: NameNode(value: 'isDefault'), + value: + VariableNode(name: NameNode(value: 'isDefault'))) + ])) + ], + directives: [], + selectionSet: null) + ])) + ]); + + @override + final String operationName = 'CreateAddress'; + + @override + final CreateAddressArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + CreateAddress$Mutation parse(Map json) => + CreateAddress$Mutation.fromJson(json); +} + +@JsonSerializable(explicitToJson: true) +class DeleteAddressArguments extends JsonSerializable with EquatableMixin { + DeleteAddressArguments({@required this.id}); + + @override + factory DeleteAddressArguments.fromJson(Map json) => + _$DeleteAddressArgumentsFromJson(json); + + final String id; + + @override + List get props => [id]; + @override + Map toJson() => _$DeleteAddressArgumentsToJson(this); +} + +class DeleteAddressMutation + extends GraphQLQuery { + DeleteAddressMutation({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'DeleteAddress'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'id')), + type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'deleteAddress'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'id'), + value: VariableNode(name: NameNode(value: 'id'))) + ], + directives: [], + selectionSet: null) + ])) + ]); + + @override + final String operationName = 'DeleteAddress'; + + @override + final DeleteAddressArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + DeleteAddress$Mutation parse(Map json) => + DeleteAddress$Mutation.fromJson(json); +} + +@JsonSerializable(explicitToJson: true) +class GetAllAddressArguments extends JsonSerializable with EquatableMixin { + GetAllAddressArguments({@required this.first, @required this.page}); + + @override + factory GetAllAddressArguments.fromJson(Map json) => + _$GetAllAddressArgumentsFromJson(json); + + final int first; + + final int page; + + @override + List get props => [first, page]; + @override + Map toJson() => _$GetAllAddressArgumentsToJson(this); +} + +class GetAllAddressQuery + extends GraphQLQuery { + GetAllAddressQuery({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'GetAllAddress'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'first')), + type: + NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'page')), + type: + NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'addresses'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'first'), + value: VariableNode(name: NameNode(value: 'first'))), + ArgumentNode( + name: NameNode(value: 'page'), + value: VariableNode(name: NameNode(value: 'page'))) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'paginatorInfo'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'Paging'), directives: []) + ])), + FieldNode( + name: NameNode(value: 'data'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'first_name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'last_name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'area'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'city'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])), + FieldNode( + name: NameNode(value: 'info'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'additional_info'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'mobile'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'lat'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'lng'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'isDefault'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ])), + FragmentDefinitionNode( + name: NameNode(value: 'Paging'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'PaginatorInfo'), isNonNull: false)), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'count'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'currentPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'firstItem'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'lastItem'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'hasMorePages'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'lastPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'perPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'total'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ]); + + @override + final String operationName = 'GetAllAddress'; + + @override + final GetAllAddressArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + GetAllAddress$Query parse(Map json) => + GetAllAddress$Query.fromJson(json); +} + +@JsonSerializable(explicitToJson: true) +class UpdateAddressArguments extends JsonSerializable with EquatableMixin { + UpdateAddressArguments( + {@required this.id, + @required this.firstName, + @required this.lastName, + @required this.areaId, + @required this.info, + @required this.additionalInfo, + @required this.mobile, + @required this.lat, + @required this.lng, + @required this.isDefault}); + + @override + factory UpdateAddressArguments.fromJson(Map json) => + _$UpdateAddressArgumentsFromJson(json); + + final String id; + + final String firstName; + + final String lastName; + + final String areaId; + + final String info; + + final String additionalInfo; + + final String mobile; + + final String lat; + + final String lng; + + final bool isDefault; + + @override + List get props => [ + id, + firstName, + lastName, + areaId, + info, + additionalInfo, + mobile, + lat, + lng, + isDefault + ]; + @override + Map toJson() => _$UpdateAddressArgumentsToJson(this); +} + +class UpdateAddressMutation + extends GraphQLQuery { + UpdateAddressMutation({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'UpdateAddress'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'id')), + type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'firstName')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'lastName')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'areaId')), + type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'info')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'additionalInfo')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'mobile')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'lat')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'lng')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'isDefault')), + type: NamedTypeNode( + name: NameNode(value: 'Boolean'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'updateAddress'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'id'), + value: VariableNode(name: NameNode(value: 'id'))), + ArgumentNode( + name: NameNode(value: 'input'), + value: ObjectValueNode(fields: [ + ObjectFieldNode( + name: NameNode(value: 'first_name'), + value: + VariableNode(name: NameNode(value: 'firstName'))), + ObjectFieldNode( + name: NameNode(value: 'last_name'), + value: + VariableNode(name: NameNode(value: 'lastName'))), + ObjectFieldNode( + name: NameNode(value: 'area_id'), + value: VariableNode(name: NameNode(value: 'areaId'))), + ObjectFieldNode( + name: NameNode(value: 'info'), + value: VariableNode(name: NameNode(value: 'info'))), + ObjectFieldNode( + name: NameNode(value: 'additional_info'), + value: VariableNode( + name: NameNode(value: 'additionalInfo'))), + ObjectFieldNode( + name: NameNode(value: 'mobile'), + value: VariableNode(name: NameNode(value: 'mobile'))), + ObjectFieldNode( + name: NameNode(value: 'lat'), + value: VariableNode(name: NameNode(value: 'lat'))), + ObjectFieldNode( + name: NameNode(value: 'lng'), + value: VariableNode(name: NameNode(value: 'lng'))), + ObjectFieldNode( + name: NameNode(value: 'isDefault'), + value: + VariableNode(name: NameNode(value: 'isDefault'))) + ])) + ], + directives: [], + selectionSet: null) + ])) + ]); + + @override + final String operationName = 'UpdateAddress'; + + @override + final UpdateAddressArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + UpdateAddress$Mutation parse(Map json) => + UpdateAddress$Mutation.fromJson(json); +} diff --git a/lib/generatedql/address/graphql_api.graphql.g.dart b/lib/generatedql/address/graphql_api.graphql.g.dart new file mode 100644 index 0000000..a86de08 --- /dev/null +++ b/lib/generatedql/address/graphql_api.graphql.g.dart @@ -0,0 +1,265 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'graphql_api.graphql.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +CreateAddress$Mutation _$CreateAddress$MutationFromJson( + Map json) { + return CreateAddress$Mutation() + ..createAddress = json['createAddress'] as bool; +} + +Map _$CreateAddress$MutationToJson( + CreateAddress$Mutation instance) => + { + 'createAddress': instance.createAddress, + }; + +DeleteAddress$Mutation _$DeleteAddress$MutationFromJson( + Map json) { + return DeleteAddress$Mutation() + ..deleteAddress = json['deleteAddress'] as bool; +} + +Map _$DeleteAddress$MutationToJson( + DeleteAddress$Mutation instance) => + { + 'deleteAddress': instance.deleteAddress, + }; + +GetAllAddress$Query$UserAddressPaginator$PaginatorInfo + _$GetAllAddress$Query$UserAddressPaginator$PaginatorInfoFromJson( + Map json) { + return GetAllAddress$Query$UserAddressPaginator$PaginatorInfo() + ..count = json['count'] as int + ..currentPage = json['currentPage'] as int + ..firstItem = json['firstItem'] as int + ..lastItem = json['lastItem'] as int + ..hasMorePages = json['hasMorePages'] as bool + ..lastPage = json['lastPage'] as int + ..perPage = json['perPage'] as int + ..total = json['total'] as int; +} + +Map + _$GetAllAddress$Query$UserAddressPaginator$PaginatorInfoToJson( + GetAllAddress$Query$UserAddressPaginator$PaginatorInfo instance) => + { + 'count': instance.count, + 'currentPage': instance.currentPage, + 'firstItem': instance.firstItem, + 'lastItem': instance.lastItem, + 'hasMorePages': instance.hasMorePages, + 'lastPage': instance.lastPage, + 'perPage': instance.perPage, + 'total': instance.total, + }; + +GetAllAddress$Query$UserAddressPaginator$UserAddress$Area$City + _$GetAllAddress$Query$UserAddressPaginator$UserAddress$Area$CityFromJson( + Map json) { + return GetAllAddress$Query$UserAddressPaginator$UserAddress$Area$City() + ..name = json['name'] as String; +} + +Map + _$GetAllAddress$Query$UserAddressPaginator$UserAddress$Area$CityToJson( + GetAllAddress$Query$UserAddressPaginator$UserAddress$Area$City + instance) => + { + 'name': instance.name, + }; + +GetAllAddress$Query$UserAddressPaginator$UserAddress$Area + _$GetAllAddress$Query$UserAddressPaginator$UserAddress$AreaFromJson( + Map json) { + return GetAllAddress$Query$UserAddressPaginator$UserAddress$Area() + ..name = json['name'] as String + ..city = json['city'] == null + ? null + : GetAllAddress$Query$UserAddressPaginator$UserAddress$Area$City + .fromJson(json['city'] as Map); +} + +Map _$GetAllAddress$Query$UserAddressPaginator$UserAddress$AreaToJson( + GetAllAddress$Query$UserAddressPaginator$UserAddress$Area instance) => + { + 'name': instance.name, + 'city': instance.city?.toJson(), + }; + +GetAllAddress$Query$UserAddressPaginator$UserAddress + _$GetAllAddress$Query$UserAddressPaginator$UserAddressFromJson( + Map json) { + return GetAllAddress$Query$UserAddressPaginator$UserAddress() + ..id = json['id'] as String + ..firstName = json['first_name'] as String + ..lastName = json['last_name'] as String + ..area = json['area'] == null + ? null + : GetAllAddress$Query$UserAddressPaginator$UserAddress$Area.fromJson( + json['area'] as Map) + ..info = json['info'] as String + ..additionalInfo = json['additional_info'] as String + ..mobile = json['mobile'] as String + ..lat = json['lat'] as String + ..lng = json['lng'] as String + ..isDefault = json['isDefault'] as bool; +} + +Map + _$GetAllAddress$Query$UserAddressPaginator$UserAddressToJson( + GetAllAddress$Query$UserAddressPaginator$UserAddress instance) => + { + 'id': instance.id, + 'first_name': instance.firstName, + 'last_name': instance.lastName, + 'area': instance.area?.toJson(), + 'info': instance.info, + 'additional_info': instance.additionalInfo, + 'mobile': instance.mobile, + 'lat': instance.lat, + 'lng': instance.lng, + 'isDefault': instance.isDefault, + }; + +GetAllAddress$Query$UserAddressPaginator + _$GetAllAddress$Query$UserAddressPaginatorFromJson( + Map json) { + return GetAllAddress$Query$UserAddressPaginator() + ..paginatorInfo = json['paginatorInfo'] == null + ? null + : GetAllAddress$Query$UserAddressPaginator$PaginatorInfo.fromJson( + json['paginatorInfo'] as Map) + ..data = (json['data'] as List) + ?.map((e) => e == null + ? null + : GetAllAddress$Query$UserAddressPaginator$UserAddress.fromJson( + e as Map)) + ?.toList(); +} + +Map _$GetAllAddress$Query$UserAddressPaginatorToJson( + GetAllAddress$Query$UserAddressPaginator instance) => + { + 'paginatorInfo': instance.paginatorInfo?.toJson(), + 'data': instance.data?.map((e) => e?.toJson())?.toList(), + }; + +GetAllAddress$Query _$GetAllAddress$QueryFromJson(Map json) { + return GetAllAddress$Query() + ..addresses = json['addresses'] == null + ? null + : GetAllAddress$Query$UserAddressPaginator.fromJson( + json['addresses'] as Map); +} + +Map _$GetAllAddress$QueryToJson( + GetAllAddress$Query instance) => + { + 'addresses': instance.addresses?.toJson(), + }; + +UpdateAddress$Mutation _$UpdateAddress$MutationFromJson( + Map json) { + return UpdateAddress$Mutation() + ..updateAddress = json['updateAddress'] as bool; +} + +Map _$UpdateAddress$MutationToJson( + UpdateAddress$Mutation instance) => + { + 'updateAddress': instance.updateAddress, + }; + +CreateAddressArguments _$CreateAddressArgumentsFromJson( + Map json) { + return CreateAddressArguments( + firstName: json['firstName'] as String, + lastName: json['lastName'] as String, + areaId: json['areaId'] as String, + info: json['info'] as String, + additionalInfo: json['additionalInfo'] as String, + mobile: json['mobile'] as String, + lat: json['lat'] as String, + lng: json['lng'] as String, + isDefault: json['isDefault'] as bool, + ); +} + +Map _$CreateAddressArgumentsToJson( + CreateAddressArguments instance) => + { + 'firstName': instance.firstName, + 'lastName': instance.lastName, + 'areaId': instance.areaId, + 'info': instance.info, + 'additionalInfo': instance.additionalInfo, + 'mobile': instance.mobile, + 'lat': instance.lat, + 'lng': instance.lng, + 'isDefault': instance.isDefault, + }; + +DeleteAddressArguments _$DeleteAddressArgumentsFromJson( + Map json) { + return DeleteAddressArguments( + id: json['id'] as String, + ); +} + +Map _$DeleteAddressArgumentsToJson( + DeleteAddressArguments instance) => + { + 'id': instance.id, + }; + +GetAllAddressArguments _$GetAllAddressArgumentsFromJson( + Map json) { + return GetAllAddressArguments( + first: json['first'] as int, + page: json['page'] as int, + ); +} + +Map _$GetAllAddressArgumentsToJson( + GetAllAddressArguments instance) => + { + 'first': instance.first, + 'page': instance.page, + }; + +UpdateAddressArguments _$UpdateAddressArgumentsFromJson( + Map json) { + return UpdateAddressArguments( + id: json['id'] as String, + firstName: json['firstName'] as String, + lastName: json['lastName'] as String, + areaId: json['areaId'] as String, + info: json['info'] as String, + additionalInfo: json['additionalInfo'] as String, + mobile: json['mobile'] as String, + lat: json['lat'] as String, + lng: json['lng'] as String, + isDefault: json['isDefault'] as bool, + ); +} + +Map _$UpdateAddressArgumentsToJson( + UpdateAddressArguments instance) => + { + 'id': instance.id, + 'firstName': instance.firstName, + 'lastName': instance.lastName, + 'areaId': instance.areaId, + 'info': instance.info, + 'additionalInfo': instance.additionalInfo, + 'mobile': instance.mobile, + 'lat': instance.lat, + 'lng': instance.lng, + 'isDefault': instance.isDefault, + }; diff --git a/lib/generatedql/address_asset/graphql_api.dart b/lib/generatedql/address_asset/graphql_api.dart index e5cd7a2..196c5cd 100644 --- a/lib/generatedql/address_asset/graphql_api.dart +++ b/lib/generatedql/address_asset/graphql_api.dart @@ -1,175 +1,2 @@ // GENERATED CODE - DO NOT MODIFY BY HAND - -import 'package:artemis/artemis.dart'; -import 'package:json_annotation/json_annotation.dart'; -import 'package:equatable/equatable.dart'; -import 'package:gql/ast.dart'; -part 'graphql_api.g.dart'; - -@JsonSerializable(explicitToJson: true) -class AreaByID with EquatableMixin { - AreaByID(); - - factory AreaByID.fromJson(Map json) => - _$AreaByIDFromJson(json); - - List areas; - - @override - List get props => [areas]; - Map toJson() => _$AreaByIDToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Area with EquatableMixin { - Area(); - - factory Area.fromJson(Map json) => _$AreaFromJson(json); - - String id; - - String name; - - @override - List get props => [id, name]; - Map toJson() => _$AreaToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class AreaByIDArguments extends JsonSerializable with EquatableMixin { - AreaByIDArguments({this.cityId}); - - factory AreaByIDArguments.fromJson(Map json) => - _$AreaByIDArgumentsFromJson(json); - - final String cityId; - - @override - List get props => [cityId]; - Map toJson() => _$AreaByIDArgumentsToJson(this); -} - -class AreaByIDQuery extends GraphQLQuery { - AreaByIDQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'AreaByID'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'cityId')), - type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'areas'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'city_id'), - value: VariableNode(name: NameNode(value: 'cityId'))) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ]); - - @override - final String operationName = 'AreaByID'; - - @override - final AreaByIDArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - AreaByID parse(Map json) => AreaByID.fromJson(json); -} - -@JsonSerializable(explicitToJson: true) -class Cities with EquatableMixin { - Cities(); - - factory Cities.fromJson(Map json) => _$CitiesFromJson(json); - - List cities; - - @override - List get props => [cities]; - Map toJson() => _$CitiesToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class City with EquatableMixin { - City(); - - factory City.fromJson(Map json) => _$CityFromJson(json); - - String id; - - String name; - - @override - List get props => [id, name]; - Map toJson() => _$CityToJson(this); -} - -class CitiesQuery extends GraphQLQuery { - CitiesQuery(); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'Cities'), - variableDefinitions: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'cities'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ]); - - @override - final String operationName = 'Cities'; - - @override - List get props => [document, operationName]; - @override - Cities parse(Map json) => Cities.fromJson(json); -} +export 'graphql_api.graphql.dart'; diff --git a/lib/generatedql/address_asset/graphql_api.g.dart b/lib/generatedql/address_asset/graphql_api.g.dart deleted file mode 100644 index 4be712d..0000000 --- a/lib/generatedql/address_asset/graphql_api.g.dart +++ /dev/null @@ -1,64 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'graphql_api.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -AreaByID _$AreaByIDFromJson(Map json) { - return AreaByID() - ..areas = (json['areas'] as List) - ?.map( - (e) => e == null ? null : Area.fromJson(e as Map)) - ?.toList(); -} - -Map _$AreaByIDToJson(AreaByID instance) => { - 'areas': instance.areas?.map((e) => e?.toJson())?.toList(), - }; - -Area _$AreaFromJson(Map json) { - return Area() - ..id = json['id'] as String - ..name = json['name'] as String; -} - -Map _$AreaToJson(Area instance) => { - 'id': instance.id, - 'name': instance.name, - }; - -AreaByIDArguments _$AreaByIDArgumentsFromJson(Map json) { - return AreaByIDArguments( - cityId: json['cityId'] as String, - ); -} - -Map _$AreaByIDArgumentsToJson(AreaByIDArguments instance) => - { - 'cityId': instance.cityId, - }; - -Cities _$CitiesFromJson(Map json) { - return Cities() - ..cities = (json['cities'] as List) - ?.map( - (e) => e == null ? null : City.fromJson(e as Map)) - ?.toList(); -} - -Map _$CitiesToJson(Cities instance) => { - 'cities': instance.cities?.map((e) => e?.toJson())?.toList(), - }; - -City _$CityFromJson(Map json) { - return City() - ..id = json['id'] as String - ..name = json['name'] as String; -} - -Map _$CityToJson(City instance) => { - 'id': instance.id, - 'name': instance.name, - }; diff --git a/lib/generatedql/address_asset/graphql_api.graphql.dart b/lib/generatedql/address_asset/graphql_api.graphql.dart new file mode 100644 index 0000000..2cc5373 --- /dev/null +++ b/lib/generatedql/address_asset/graphql_api.graphql.dart @@ -0,0 +1,182 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +import 'package:meta/meta.dart'; +import 'package:artemis/artemis.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:equatable/equatable.dart'; +import 'package:gql/ast.dart'; +part 'graphql_api.graphql.g.dart'; + +@JsonSerializable(explicitToJson: true) +class AreaByID$Query$Area with EquatableMixin { + AreaByID$Query$Area(); + + factory AreaByID$Query$Area.fromJson(Map json) => + _$AreaByID$Query$AreaFromJson(json); + + String id; + + String name; + + @override + List get props => [id, name]; + Map toJson() => _$AreaByID$Query$AreaToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class AreaByID$Query with EquatableMixin { + AreaByID$Query(); + + factory AreaByID$Query.fromJson(Map json) => + _$AreaByID$QueryFromJson(json); + + List areas; + + @override + List get props => [areas]; + Map toJson() => _$AreaByID$QueryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Cities$Query$City with EquatableMixin { + Cities$Query$City(); + + factory Cities$Query$City.fromJson(Map json) => + _$Cities$Query$CityFromJson(json); + + String id; + + String name; + + @override + List get props => [id, name]; + Map toJson() => _$Cities$Query$CityToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Cities$Query with EquatableMixin { + Cities$Query(); + + factory Cities$Query.fromJson(Map json) => + _$Cities$QueryFromJson(json); + + List cities; + + @override + List get props => [cities]; + Map toJson() => _$Cities$QueryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class AreaByIDArguments extends JsonSerializable with EquatableMixin { + AreaByIDArguments({@required this.cityId}); + + @override + factory AreaByIDArguments.fromJson(Map json) => + _$AreaByIDArgumentsFromJson(json); + + final String cityId; + + @override + List get props => [cityId]; + @override + Map toJson() => _$AreaByIDArgumentsToJson(this); +} + +class AreaByIDQuery extends GraphQLQuery { + AreaByIDQuery({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'AreaByID'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'cityId')), + type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'areas'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'city_id'), + value: VariableNode(name: NameNode(value: 'cityId'))) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ]); + + @override + final String operationName = 'AreaByID'; + + @override + final AreaByIDArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + AreaByID$Query parse(Map json) => + AreaByID$Query.fromJson(json); +} + +class CitiesQuery extends GraphQLQuery { + CitiesQuery(); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'Cities'), + variableDefinitions: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'cities'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ]); + + @override + final String operationName = 'Cities'; + + @override + List get props => [document, operationName]; + @override + Cities$Query parse(Map json) => Cities$Query.fromJson(json); +} diff --git a/lib/generatedql/address_asset/graphql_api.graphql.g.dart b/lib/generatedql/address_asset/graphql_api.graphql.g.dart new file mode 100644 index 0000000..7e12532 --- /dev/null +++ b/lib/generatedql/address_asset/graphql_api.graphql.g.dart @@ -0,0 +1,71 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'graphql_api.graphql.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AreaByID$Query$Area _$AreaByID$Query$AreaFromJson(Map json) { + return AreaByID$Query$Area() + ..id = json['id'] as String + ..name = json['name'] as String; +} + +Map _$AreaByID$Query$AreaToJson( + AreaByID$Query$Area instance) => + { + 'id': instance.id, + 'name': instance.name, + }; + +AreaByID$Query _$AreaByID$QueryFromJson(Map json) { + return AreaByID$Query() + ..areas = (json['areas'] as List) + ?.map((e) => e == null + ? null + : AreaByID$Query$Area.fromJson(e as Map)) + ?.toList(); +} + +Map _$AreaByID$QueryToJson(AreaByID$Query instance) => + { + 'areas': instance.areas?.map((e) => e?.toJson())?.toList(), + }; + +Cities$Query$City _$Cities$Query$CityFromJson(Map json) { + return Cities$Query$City() + ..id = json['id'] as String + ..name = json['name'] as String; +} + +Map _$Cities$Query$CityToJson(Cities$Query$City instance) => + { + 'id': instance.id, + 'name': instance.name, + }; + +Cities$Query _$Cities$QueryFromJson(Map json) { + return Cities$Query() + ..cities = (json['cities'] as List) + ?.map((e) => e == null + ? null + : Cities$Query$City.fromJson(e as Map)) + ?.toList(); +} + +Map _$Cities$QueryToJson(Cities$Query instance) => + { + 'cities': instance.cities?.map((e) => e?.toJson())?.toList(), + }; + +AreaByIDArguments _$AreaByIDArgumentsFromJson(Map json) { + return AreaByIDArguments( + cityId: json['cityId'] as String, + ); +} + +Map _$AreaByIDArgumentsToJson(AreaByIDArguments instance) => + { + 'cityId': instance.cityId, + }; diff --git a/lib/generatedql/auth/graphql_api.dart b/lib/generatedql/auth/graphql_api.dart index 10f5caa..196c5cd 100644 --- a/lib/generatedql/auth/graphql_api.dart +++ b/lib/generatedql/auth/graphql_api.dart @@ -1,511 +1,2 @@ // GENERATED CODE - DO NOT MODIFY BY HAND - -import 'package:artemis/artemis.dart'; -import 'package:json_annotation/json_annotation.dart'; -import 'package:equatable/equatable.dart'; -import 'package:gql/ast.dart'; -part 'graphql_api.g.dart'; - -@JsonSerializable(explicitToJson: true) -class SignUp with EquatableMixin { - SignUp(); - - factory SignUp.fromJson(Map json) => _$SignUpFromJson(json); - - User register; - - @override - List get props => [register]; - Map toJson() => _$SignUpToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class User with EquatableMixin { - User(); - - factory User.fromJson(Map json) => _$UserFromJson(json); - - String id; - - String name; - - String email; - - String mobile; - - @override - List get props => [id, name, email, mobile]; - Map toJson() => _$UserToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class SignUpArguments extends JsonSerializable with EquatableMixin { - SignUpArguments({this.name, this.email, this.password}); - - factory SignUpArguments.fromJson(Map json) => - _$SignUpArgumentsFromJson(json); - - final String name; - - final String email; - - final String password; - - @override - List get props => [name, email, password]; - Map toJson() => _$SignUpArgumentsToJson(this); -} - -class SignUpQuery extends GraphQLQuery { - SignUpQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.mutation, - name: NameNode(value: 'SignUp'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'name')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'email')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'password')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'register'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'input'), - value: ObjectValueNode(fields: [ - ObjectFieldNode( - name: NameNode(value: 'name'), - value: VariableNode(name: NameNode(value: 'name'))), - ObjectFieldNode( - name: NameNode(value: 'email'), - value: VariableNode(name: NameNode(value: 'email'))), - ObjectFieldNode( - name: NameNode(value: 'password'), - value: - VariableNode(name: NameNode(value: 'password'))), - ObjectFieldNode( - name: NameNode(value: 'password_confirmation'), - value: - VariableNode(name: NameNode(value: 'password'))) - ])) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'email'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'mobile'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ]); - - @override - final String operationName = 'SignUp'; - - @override - final SignUpArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - SignUp parse(Map json) => SignUp.fromJson(json); -} - -@JsonSerializable(explicitToJson: true) -class ResetPassword with EquatableMixin { - ResetPassword(); - - factory ResetPassword.fromJson(Map json) => - _$ResetPasswordFromJson(json); - - bool resetPassword; - - @override - List get props => [resetPassword]; - Map toJson() => _$ResetPasswordToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class ResetPasswordArguments extends JsonSerializable with EquatableMixin { - ResetPasswordArguments({this.email, this.newPassword, this.token}); - - factory ResetPasswordArguments.fromJson(Map json) => - _$ResetPasswordArgumentsFromJson(json); - - final String email; - - final String newPassword; - - final String token; - - @override - List get props => [email, newPassword, token]; - Map toJson() => _$ResetPasswordArgumentsToJson(this); -} - -class ResetPasswordQuery - extends GraphQLQuery { - ResetPasswordQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.mutation, - name: NameNode(value: 'ResetPassword'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'email')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'newPassword')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'token')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'resetPassword'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'input'), - value: ObjectValueNode(fields: [ - ObjectFieldNode( - name: NameNode(value: 'email'), - value: VariableNode(name: NameNode(value: 'email'))), - ObjectFieldNode( - name: NameNode(value: 'new_password'), - value: VariableNode( - name: NameNode(value: 'newPassword'))), - ObjectFieldNode( - name: NameNode(value: 'token'), - value: VariableNode(name: NameNode(value: 'token'))) - ])) - ], - directives: [], - selectionSet: null) - ])) - ]); - - @override - final String operationName = 'ResetPassword'; - - @override - final ResetPasswordArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - ResetPassword parse(Map json) => - ResetPassword.fromJson(json); -} - -@JsonSerializable(explicitToJson: true) -class Logout with EquatableMixin { - Logout(); - - factory Logout.fromJson(Map json) => _$LogoutFromJson(json); - - bool logout; - - @override - List get props => [logout]; - Map toJson() => _$LogoutToJson(this); -} - -class LogoutQuery extends GraphQLQuery { - LogoutQuery(); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.mutation, - name: NameNode(value: 'Logout'), - variableDefinitions: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'logout'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ]); - - @override - final String operationName = 'Logout'; - - @override - List get props => [document, operationName]; - @override - Logout parse(Map json) => Logout.fromJson(json); -} - -@JsonSerializable(explicitToJson: true) -class ForgetPassword with EquatableMixin { - ForgetPassword(); - - factory ForgetPassword.fromJson(Map json) => - _$ForgetPasswordFromJson(json); - - bool forgetPassword; - - @override - List get props => [forgetPassword]; - Map toJson() => _$ForgetPasswordToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class ForgetPasswordArguments extends JsonSerializable with EquatableMixin { - ForgetPasswordArguments({this.email}); - - factory ForgetPasswordArguments.fromJson(Map json) => - _$ForgetPasswordArgumentsFromJson(json); - - final String email; - - @override - List get props => [email]; - Map toJson() => _$ForgetPasswordArgumentsToJson(this); -} - -class ForgetPasswordQuery - extends GraphQLQuery { - ForgetPasswordQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.mutation, - name: NameNode(value: 'ForgetPassword'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'email')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'forgetPassword'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'email'), - value: VariableNode(name: NameNode(value: 'email'))) - ], - directives: [], - selectionSet: null) - ])) - ]); - - @override - final String operationName = 'ForgetPassword'; - - @override - final ForgetPasswordArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - ForgetPassword parse(Map json) => - ForgetPassword.fromJson(json); -} - -@JsonSerializable(explicitToJson: true) -class SignIn with EquatableMixin { - SignIn(); - - factory SignIn.fromJson(Map json) => _$SignInFromJson(json); - - AuthPayload login; - - @override - List get props => [login]; - Map toJson() => _$SignInToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class AuthPayload with EquatableMixin { - AuthPayload(); - - factory AuthPayload.fromJson(Map json) => - _$AuthPayloadFromJson(json); - - String access_token; - - String refresh_token; - - int expires_in; - - String token_type; - - @override - List get props => - [access_token, refresh_token, expires_in, token_type]; - Map toJson() => _$AuthPayloadToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class SignInArguments extends JsonSerializable with EquatableMixin { - SignInArguments({this.email, this.password, this.deviceToken}); - - factory SignInArguments.fromJson(Map json) => - _$SignInArgumentsFromJson(json); - - final String email; - - final String password; - - final String deviceToken; - - @override - List get props => [email, password, deviceToken]; - Map toJson() => _$SignInArgumentsToJson(this); -} - -class SignInQuery extends GraphQLQuery { - SignInQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.mutation, - name: NameNode(value: 'SignIn'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'email')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'password')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'deviceToken')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'login'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'input'), - value: ObjectValueNode(fields: [ - ObjectFieldNode( - name: NameNode(value: 'email'), - value: VariableNode(name: NameNode(value: 'email'))), - ObjectFieldNode( - name: NameNode(value: 'password'), - value: - VariableNode(name: NameNode(value: 'password'))), - ObjectFieldNode( - name: NameNode(value: 'device_token'), - value: VariableNode( - name: NameNode(value: 'deviceToken'))) - ])) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'access_token'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'refresh_token'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'expires_in'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'token_type'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ]); - - @override - final String operationName = 'SignIn'; - - @override - final SignInArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - SignIn parse(Map json) => SignIn.fromJson(json); -} +export 'graphql_api.graphql.dart'; diff --git a/lib/generatedql/auth/graphql_api.graphql.dart b/lib/generatedql/auth/graphql_api.graphql.dart new file mode 100644 index 0000000..e36afe1 --- /dev/null +++ b/lib/generatedql/auth/graphql_api.graphql.dart @@ -0,0 +1,535 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +import 'package:meta/meta.dart'; +import 'package:artemis/artemis.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:equatable/equatable.dart'; +import 'package:gql/ast.dart'; +part 'graphql_api.graphql.g.dart'; + +@JsonSerializable(explicitToJson: true) +class SignUp$Mutation$User with EquatableMixin { + SignUp$Mutation$User(); + + factory SignUp$Mutation$User.fromJson(Map json) => + _$SignUp$Mutation$UserFromJson(json); + + String id; + + String name; + + String email; + + String mobile; + + @override + List get props => [id, name, email, mobile]; + Map toJson() => _$SignUp$Mutation$UserToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class SignUp$Mutation with EquatableMixin { + SignUp$Mutation(); + + factory SignUp$Mutation.fromJson(Map json) => + _$SignUp$MutationFromJson(json); + + SignUp$Mutation$User register; + + @override + List get props => [register]; + Map toJson() => _$SignUp$MutationToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ResetPassword$Mutation with EquatableMixin { + ResetPassword$Mutation(); + + factory ResetPassword$Mutation.fromJson(Map json) => + _$ResetPassword$MutationFromJson(json); + + bool resetPassword; + + @override + List get props => [resetPassword]; + Map toJson() => _$ResetPassword$MutationToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Logout$Mutation with EquatableMixin { + Logout$Mutation(); + + factory Logout$Mutation.fromJson(Map json) => + _$Logout$MutationFromJson(json); + + bool logout; + + @override + List get props => [logout]; + Map toJson() => _$Logout$MutationToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ForgetPassword$Mutation with EquatableMixin { + ForgetPassword$Mutation(); + + factory ForgetPassword$Mutation.fromJson(Map json) => + _$ForgetPassword$MutationFromJson(json); + + bool forgetPassword; + + @override + List get props => [forgetPassword]; + Map toJson() => _$ForgetPassword$MutationToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class SignIn$Mutation$AuthPayload with EquatableMixin { + SignIn$Mutation$AuthPayload(); + + factory SignIn$Mutation$AuthPayload.fromJson(Map json) => + _$SignIn$Mutation$AuthPayloadFromJson(json); + + @JsonKey(name: 'access_token') + String accessToken; + + @JsonKey(name: 'refresh_token') + String refreshToken; + + @JsonKey(name: 'expires_in') + int expiresIn; + + @JsonKey(name: 'token_type') + String tokenType; + + @override + List get props => [accessToken, refreshToken, expiresIn, tokenType]; + Map toJson() => _$SignIn$Mutation$AuthPayloadToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class SignIn$Mutation with EquatableMixin { + SignIn$Mutation(); + + factory SignIn$Mutation.fromJson(Map json) => + _$SignIn$MutationFromJson(json); + + SignIn$Mutation$AuthPayload login; + + @override + List get props => [login]; + Map toJson() => _$SignIn$MutationToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class SignUpArguments extends JsonSerializable with EquatableMixin { + SignUpArguments( + {@required this.name, @required this.email, @required this.password}); + + @override + factory SignUpArguments.fromJson(Map json) => + _$SignUpArgumentsFromJson(json); + + final String name; + + final String email; + + final String password; + + @override + List get props => [name, email, password]; + @override + Map toJson() => _$SignUpArgumentsToJson(this); +} + +class SignUpMutation extends GraphQLQuery { + SignUpMutation({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'SignUp'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'name')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'email')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'password')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'register'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'input'), + value: ObjectValueNode(fields: [ + ObjectFieldNode( + name: NameNode(value: 'name'), + value: VariableNode(name: NameNode(value: 'name'))), + ObjectFieldNode( + name: NameNode(value: 'email'), + value: VariableNode(name: NameNode(value: 'email'))), + ObjectFieldNode( + name: NameNode(value: 'password'), + value: + VariableNode(name: NameNode(value: 'password'))), + ObjectFieldNode( + name: NameNode(value: 'password_confirmation'), + value: + VariableNode(name: NameNode(value: 'password'))) + ])) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'email'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'mobile'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ]); + + @override + final String operationName = 'SignUp'; + + @override + final SignUpArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + SignUp$Mutation parse(Map json) => + SignUp$Mutation.fromJson(json); +} + +@JsonSerializable(explicitToJson: true) +class ResetPasswordArguments extends JsonSerializable with EquatableMixin { + ResetPasswordArguments( + {@required this.email, @required this.newPassword, @required this.token}); + + @override + factory ResetPasswordArguments.fromJson(Map json) => + _$ResetPasswordArgumentsFromJson(json); + + final String email; + + final String newPassword; + + final String token; + + @override + List get props => [email, newPassword, token]; + @override + Map toJson() => _$ResetPasswordArgumentsToJson(this); +} + +class ResetPasswordMutation + extends GraphQLQuery { + ResetPasswordMutation({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'ResetPassword'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'email')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'newPassword')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'token')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'resetPassword'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'input'), + value: ObjectValueNode(fields: [ + ObjectFieldNode( + name: NameNode(value: 'email'), + value: VariableNode(name: NameNode(value: 'email'))), + ObjectFieldNode( + name: NameNode(value: 'new_password'), + value: VariableNode( + name: NameNode(value: 'newPassword'))), + ObjectFieldNode( + name: NameNode(value: 'token'), + value: VariableNode(name: NameNode(value: 'token'))) + ])) + ], + directives: [], + selectionSet: null) + ])) + ]); + + @override + final String operationName = 'ResetPassword'; + + @override + final ResetPasswordArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + ResetPassword$Mutation parse(Map json) => + ResetPassword$Mutation.fromJson(json); +} + +class LogoutMutation extends GraphQLQuery { + LogoutMutation(); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'Logout'), + variableDefinitions: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'logout'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ]); + + @override + final String operationName = 'Logout'; + + @override + List get props => [document, operationName]; + @override + Logout$Mutation parse(Map json) => + Logout$Mutation.fromJson(json); +} + +@JsonSerializable(explicitToJson: true) +class ForgetPasswordArguments extends JsonSerializable with EquatableMixin { + ForgetPasswordArguments({@required this.email}); + + @override + factory ForgetPasswordArguments.fromJson(Map json) => + _$ForgetPasswordArgumentsFromJson(json); + + final String email; + + @override + List get props => [email]; + @override + Map toJson() => _$ForgetPasswordArgumentsToJson(this); +} + +class ForgetPasswordMutation + extends GraphQLQuery { + ForgetPasswordMutation({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'ForgetPassword'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'email')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'forgetPassword'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'email'), + value: VariableNode(name: NameNode(value: 'email'))) + ], + directives: [], + selectionSet: null) + ])) + ]); + + @override + final String operationName = 'ForgetPassword'; + + @override + final ForgetPasswordArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + ForgetPassword$Mutation parse(Map json) => + ForgetPassword$Mutation.fromJson(json); +} + +@JsonSerializable(explicitToJson: true) +class SignInArguments extends JsonSerializable with EquatableMixin { + SignInArguments( + {@required this.email, + @required this.password, + @required this.deviceToken}); + + @override + factory SignInArguments.fromJson(Map json) => + _$SignInArgumentsFromJson(json); + + final String email; + + final String password; + + final String deviceToken; + + @override + List get props => [email, password, deviceToken]; + @override + Map toJson() => _$SignInArgumentsToJson(this); +} + +class SignInMutation extends GraphQLQuery { + SignInMutation({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'SignIn'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'email')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'password')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'deviceToken')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'login'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'input'), + value: ObjectValueNode(fields: [ + ObjectFieldNode( + name: NameNode(value: 'email'), + value: VariableNode(name: NameNode(value: 'email'))), + ObjectFieldNode( + name: NameNode(value: 'password'), + value: + VariableNode(name: NameNode(value: 'password'))), + ObjectFieldNode( + name: NameNode(value: 'device_token'), + value: VariableNode( + name: NameNode(value: 'deviceToken'))) + ])) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'access_token'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'refresh_token'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'expires_in'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'token_type'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ]); + + @override + final String operationName = 'SignIn'; + + @override + final SignInArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + SignIn$Mutation parse(Map json) => + SignIn$Mutation.fromJson(json); +} diff --git a/lib/generatedql/auth/graphql_api.g.dart b/lib/generatedql/auth/graphql_api.graphql.g.dart similarity index 54% rename from lib/generatedql/auth/graphql_api.g.dart rename to lib/generatedql/auth/graphql_api.graphql.g.dart index 8e3a5d9..191985d 100644 --- a/lib/generatedql/auth/graphql_api.g.dart +++ b/lib/generatedql/auth/graphql_api.graphql.g.dart @@ -1,37 +1,105 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'graphql_api.dart'; +part of 'graphql_api.graphql.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -SignUp _$SignUpFromJson(Map json) { - return SignUp() - ..register = json['register'] == null - ? null - : User.fromJson(json['register'] as Map); -} - -Map _$SignUpToJson(SignUp instance) => { - 'register': instance.register?.toJson(), - }; - -User _$UserFromJson(Map json) { - return User() +SignUp$Mutation$User _$SignUp$Mutation$UserFromJson(Map json) { + return SignUp$Mutation$User() ..id = json['id'] as String ..name = json['name'] as String ..email = json['email'] as String ..mobile = json['mobile'] as String; } -Map _$UserToJson(User instance) => { +Map _$SignUp$Mutation$UserToJson( + SignUp$Mutation$User instance) => + { 'id': instance.id, 'name': instance.name, 'email': instance.email, 'mobile': instance.mobile, }; +SignUp$Mutation _$SignUp$MutationFromJson(Map json) { + return SignUp$Mutation() + ..register = json['register'] == null + ? null + : SignUp$Mutation$User.fromJson( + json['register'] as Map); +} + +Map _$SignUp$MutationToJson(SignUp$Mutation instance) => + { + 'register': instance.register?.toJson(), + }; + +ResetPassword$Mutation _$ResetPassword$MutationFromJson( + Map json) { + return ResetPassword$Mutation() + ..resetPassword = json['resetPassword'] as bool; +} + +Map _$ResetPassword$MutationToJson( + ResetPassword$Mutation instance) => + { + 'resetPassword': instance.resetPassword, + }; + +Logout$Mutation _$Logout$MutationFromJson(Map json) { + return Logout$Mutation()..logout = json['logout'] as bool; +} + +Map _$Logout$MutationToJson(Logout$Mutation instance) => + { + 'logout': instance.logout, + }; + +ForgetPassword$Mutation _$ForgetPassword$MutationFromJson( + Map json) { + return ForgetPassword$Mutation() + ..forgetPassword = json['forgetPassword'] as bool; +} + +Map _$ForgetPassword$MutationToJson( + ForgetPassword$Mutation instance) => + { + 'forgetPassword': instance.forgetPassword, + }; + +SignIn$Mutation$AuthPayload _$SignIn$Mutation$AuthPayloadFromJson( + Map json) { + return SignIn$Mutation$AuthPayload() + ..accessToken = json['access_token'] as String + ..refreshToken = json['refresh_token'] as String + ..expiresIn = json['expires_in'] as int + ..tokenType = json['token_type'] as String; +} + +Map _$SignIn$Mutation$AuthPayloadToJson( + SignIn$Mutation$AuthPayload instance) => + { + 'access_token': instance.accessToken, + 'refresh_token': instance.refreshToken, + 'expires_in': instance.expiresIn, + 'token_type': instance.tokenType, + }; + +SignIn$Mutation _$SignIn$MutationFromJson(Map json) { + return SignIn$Mutation() + ..login = json['login'] == null + ? null + : SignIn$Mutation$AuthPayload.fromJson( + json['login'] as Map); +} + +Map _$SignIn$MutationToJson(SignIn$Mutation instance) => + { + 'login': instance.login?.toJson(), + }; + SignUpArguments _$SignUpArgumentsFromJson(Map json) { return SignUpArguments( name: json['name'] as String, @@ -47,15 +115,6 @@ Map _$SignUpArgumentsToJson(SignUpArguments instance) => 'password': instance.password, }; -ResetPassword _$ResetPasswordFromJson(Map json) { - return ResetPassword()..resetPassword = json['resetPassword'] as bool; -} - -Map _$ResetPasswordToJson(ResetPassword instance) => - { - 'resetPassword': instance.resetPassword, - }; - ResetPasswordArguments _$ResetPasswordArgumentsFromJson( Map json) { return ResetPasswordArguments( @@ -73,23 +132,6 @@ Map _$ResetPasswordArgumentsToJson( 'token': instance.token, }; -Logout _$LogoutFromJson(Map json) { - return Logout()..logout = json['logout'] as bool; -} - -Map _$LogoutToJson(Logout instance) => { - 'logout': instance.logout, - }; - -ForgetPassword _$ForgetPasswordFromJson(Map json) { - return ForgetPassword()..forgetPassword = json['forgetPassword'] as bool; -} - -Map _$ForgetPasswordToJson(ForgetPassword instance) => - { - 'forgetPassword': instance.forgetPassword, - }; - ForgetPasswordArguments _$ForgetPasswordArgumentsFromJson( Map json) { return ForgetPasswordArguments( @@ -103,33 +145,6 @@ Map _$ForgetPasswordArgumentsToJson( 'email': instance.email, }; -SignIn _$SignInFromJson(Map json) { - return SignIn() - ..login = json['login'] == null - ? null - : AuthPayload.fromJson(json['login'] as Map); -} - -Map _$SignInToJson(SignIn instance) => { - 'login': instance.login?.toJson(), - }; - -AuthPayload _$AuthPayloadFromJson(Map json) { - return AuthPayload() - ..access_token = json['access_token'] as String - ..refresh_token = json['refresh_token'] as String - ..expires_in = json['expires_in'] as int - ..token_type = json['token_type'] as String; -} - -Map _$AuthPayloadToJson(AuthPayload instance) => - { - 'access_token': instance.access_token, - 'refresh_token': instance.refresh_token, - 'expires_in': instance.expires_in, - 'token_type': instance.token_type, - }; - SignInArguments _$SignInArgumentsFromJson(Map json) { return SignInArguments( email: json['email'] as String, diff --git a/lib/generatedql/cart/graphql_api.dart b/lib/generatedql/cart/graphql_api.dart index 9ba49fb..196c5cd 100644 --- a/lib/generatedql/cart/graphql_api.dart +++ b/lib/generatedql/cart/graphql_api.dart @@ -1,616 +1,2 @@ // GENERATED CODE - DO NOT MODIFY BY HAND - -import 'package:artemis/artemis.dart'; -import 'package:json_annotation/json_annotation.dart'; -import 'package:equatable/equatable.dart'; -import 'package:gql/ast.dart'; -part 'graphql_api.g.dart'; - -@JsonSerializable(explicitToJson: true) -class AddToCart with EquatableMixin { - AddToCart(); - - factory AddToCart.fromJson(Map json) => - _$AddToCartFromJson(json); - - bool addToCart; - - @override - List get props => [addToCart]; - Map toJson() => _$AddToCartToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class AddToCartArguments extends JsonSerializable with EquatableMixin { - AddToCartArguments({this.productId, this.quantity}); - - factory AddToCartArguments.fromJson(Map json) => - _$AddToCartArgumentsFromJson(json); - - final String productId; - - final int quantity; - - @override - List get props => [productId, quantity]; - Map toJson() => _$AddToCartArgumentsToJson(this); -} - -class AddToCartQuery extends GraphQLQuery { - AddToCartQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.mutation, - name: NameNode(value: 'AddToCart'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'productId')), - type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'quantity')), - type: - NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'addToCart'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'items'), - value: ObjectValueNode(fields: [ - ObjectFieldNode( - name: NameNode(value: 'product_id'), - value: - VariableNode(name: NameNode(value: 'productId'))), - ObjectFieldNode( - name: NameNode(value: 'quantity'), - value: - VariableNode(name: NameNode(value: 'quantity'))) - ])) - ], - directives: [], - selectionSet: null) - ])) - ]); - - @override - final String operationName = 'AddToCart'; - - @override - final AddToCartArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - AddToCart parse(Map json) => AddToCart.fromJson(json); -} - -@JsonSerializable(explicitToJson: true) -class GetVoucherByCode with EquatableMixin { - GetVoucherByCode(); - - factory GetVoucherByCode.fromJson(Map json) => - _$GetVoucherByCodeFromJson(json); - - Voucher getVoucherByCode; - - @override - List get props => [getVoucherByCode]; - Map toJson() => _$GetVoucherByCodeToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Voucher with EquatableMixin { - Voucher(); - - factory Voucher.fromJson(Map json) => - _$VoucherFromJson(json); - - String id; - - String code; - - int discount; - - String discount_type; - - @override - List get props => [id, code, discount, discount_type]; - Map toJson() => _$VoucherToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class GetVoucherByCodeArguments extends JsonSerializable with EquatableMixin { - GetVoucherByCodeArguments({this.code}); - - factory GetVoucherByCodeArguments.fromJson(Map json) => - _$GetVoucherByCodeArgumentsFromJson(json); - - final String code; - - @override - List get props => [code]; - Map toJson() => _$GetVoucherByCodeArgumentsToJson(this); -} - -class GetVoucherByCodeQuery - extends GraphQLQuery { - GetVoucherByCodeQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'GetVoucherByCode'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'code')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'getVoucherByCode'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'code'), - value: VariableNode(name: NameNode(value: 'code'))) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'code'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'discount'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'discount_type'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ]); - - @override - final String operationName = 'GetVoucherByCode'; - - @override - final GetVoucherByCodeArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - GetVoucherByCode parse(Map json) => - GetVoucherByCode.fromJson(json); -} - -mixin ProductMixin { - String id; - String averageRating; - String price; - bool available; - ProductData details; -} - -@JsonSerializable(explicitToJson: true) -class GetCart with EquatableMixin { - GetCart(); - - factory GetCart.fromJson(Map json) => - _$GetCartFromJson(json); - - Cart cart; - - @override - List get props => [cart]; - Map toJson() => _$GetCartToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Cart with EquatableMixin { - Cart(); - - factory Cart.fromJson(Map json) => _$CartFromJson(json); - - String total; - - List items; - - @override - List get props => [total, items]; - Map toJson() => _$CartToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class CartItem with EquatableMixin { - CartItem(); - - factory CartItem.fromJson(Map json) => - _$CartItemFromJson(json); - - bool available; - - int quantity; - - Product product; - - @override - List get props => [available, quantity, product]; - Map toJson() => _$CartItemToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Product with EquatableMixin, ProductMixin { - Product(); - - factory Product.fromJson(Map json) => - _$ProductFromJson(json); - - @override - List get props => [id, averageRating, price, available, details]; - Map toJson() => _$ProductToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class ProductData with EquatableMixin { - ProductData(); - - factory ProductData.fromJson(Map json) => - _$ProductDataFromJson(json); - - String name; - - String sku; - - String description; - - Media cover; - - Unit unit; - - List media; - - Category category; - - @override - List get props => - [name, sku, description, cover, unit, media, category]; - Map toJson() => _$ProductDataToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Media with EquatableMixin { - Media(); - - factory Media.fromJson(Map json) => _$MediaFromJson(json); - - String url; - - @override - List get props => [url]; - Map toJson() => _$MediaToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Unit with EquatableMixin { - Unit(); - - factory Unit.fromJson(Map json) => _$UnitFromJson(json); - - String id; - - String name; - - @override - List get props => [id, name]; - Map toJson() => _$UnitToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Category with EquatableMixin { - Category(); - - factory Category.fromJson(Map json) => - _$CategoryFromJson(json); - - String id; - - @override - List get props => [id]; - Map toJson() => _$CategoryToJson(this); -} - -class GetCartQuery extends GraphQLQuery { - GetCartQuery(); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'GetCart'), - variableDefinitions: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'cart'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'total'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'items'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'available'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'quantity'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'product'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FragmentSpreadNode( - name: NameNode(value: 'Product'), - directives: []) - ])) - ])) - ])) - ])), - FragmentDefinitionNode( - name: NameNode(value: 'Product'), - typeCondition: TypeConditionNode( - on: NamedTypeNode( - name: NameNode(value: 'Product'), isNonNull: false)), - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'averageRating'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'price'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'available'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'details'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'sku'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'description'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'cover'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'url'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'unit'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'media'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'url'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'category'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ])) - ]); - - @override - final String operationName = 'GetCart'; - - @override - List get props => [document, operationName]; - @override - GetCart parse(Map json) => GetCart.fromJson(json); -} - -@JsonSerializable(explicitToJson: true) -class ShippingFees with EquatableMixin { - ShippingFees(); - - factory ShippingFees.fromJson(Map json) => - _$ShippingFeesFromJson(json); - - String shippingFees; - - @override - List get props => [shippingFees]; - Map toJson() => _$ShippingFeesToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class ShippingFeesArguments extends JsonSerializable with EquatableMixin { - ShippingFeesArguments({this.addressId, this.voucherId}); - - factory ShippingFeesArguments.fromJson(Map json) => - _$ShippingFeesArgumentsFromJson(json); - - final String addressId; - - final String voucherId; - - @override - List get props => [addressId, voucherId]; - Map toJson() => _$ShippingFeesArgumentsToJson(this); -} - -class ShippingFeesQuery - extends GraphQLQuery { - ShippingFeesQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'ShippingFees'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'addressId')), - type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'voucherId')), - type: - NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: false), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'shippingFees'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'input'), - value: ObjectValueNode(fields: [ - ObjectFieldNode( - name: NameNode(value: 'address_id'), - value: - VariableNode(name: NameNode(value: 'addressId'))), - ObjectFieldNode( - name: NameNode(value: 'voucher_id'), - value: - VariableNode(name: NameNode(value: 'voucherId'))) - ])) - ], - directives: [], - selectionSet: null) - ])) - ]); - - @override - final String operationName = 'ShippingFees'; - - @override - final ShippingFeesArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - ShippingFees parse(Map json) => ShippingFees.fromJson(json); -} +export 'graphql_api.graphql.dart'; diff --git a/lib/generatedql/cart/graphql_api.g.dart b/lib/generatedql/cart/graphql_api.g.dart deleted file mode 100644 index 2a528f6..0000000 --- a/lib/generatedql/cart/graphql_api.g.dart +++ /dev/null @@ -1,209 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'graphql_api.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -AddToCart _$AddToCartFromJson(Map json) { - return AddToCart()..addToCart = json['addToCart'] as bool; -} - -Map _$AddToCartToJson(AddToCart instance) => { - 'addToCart': instance.addToCart, - }; - -AddToCartArguments _$AddToCartArgumentsFromJson(Map json) { - return AddToCartArguments( - productId: json['productId'] as String, - quantity: json['quantity'] as int, - ); -} - -Map _$AddToCartArgumentsToJson(AddToCartArguments instance) => - { - 'productId': instance.productId, - 'quantity': instance.quantity, - }; - -GetVoucherByCode _$GetVoucherByCodeFromJson(Map json) { - return GetVoucherByCode() - ..getVoucherByCode = json['getVoucherByCode'] == null - ? null - : Voucher.fromJson(json['getVoucherByCode'] as Map); -} - -Map _$GetVoucherByCodeToJson(GetVoucherByCode instance) => - { - 'getVoucherByCode': instance.getVoucherByCode?.toJson(), - }; - -Voucher _$VoucherFromJson(Map json) { - return Voucher() - ..id = json['id'] as String - ..code = json['code'] as String - ..discount = json['discount'] as int - ..discount_type = json['discount_type'] as String; -} - -Map _$VoucherToJson(Voucher instance) => { - 'id': instance.id, - 'code': instance.code, - 'discount': instance.discount, - 'discount_type': instance.discount_type, - }; - -GetVoucherByCodeArguments _$GetVoucherByCodeArgumentsFromJson( - Map json) { - return GetVoucherByCodeArguments( - code: json['code'] as String, - ); -} - -Map _$GetVoucherByCodeArgumentsToJson( - GetVoucherByCodeArguments instance) => - { - 'code': instance.code, - }; - -GetCart _$GetCartFromJson(Map json) { - return GetCart() - ..cart = json['cart'] == null - ? null - : Cart.fromJson(json['cart'] as Map); -} - -Map _$GetCartToJson(GetCart instance) => { - 'cart': instance.cart?.toJson(), - }; - -Cart _$CartFromJson(Map json) { - return Cart() - ..total = json['total'] as String - ..items = (json['items'] as List) - ?.map((e) => - e == null ? null : CartItem.fromJson(e as Map)) - ?.toList(); -} - -Map _$CartToJson(Cart instance) => { - 'total': instance.total, - 'items': instance.items?.map((e) => e?.toJson())?.toList(), - }; - -CartItem _$CartItemFromJson(Map json) { - return CartItem() - ..available = json['available'] as bool - ..quantity = json['quantity'] as int - ..product = json['product'] == null - ? null - : Product.fromJson(json['product'] as Map); -} - -Map _$CartItemToJson(CartItem instance) => { - 'available': instance.available, - 'quantity': instance.quantity, - 'product': instance.product?.toJson(), - }; - -Product _$ProductFromJson(Map json) { - return Product() - ..id = json['id'] as String - ..averageRating = json['averageRating'] as String - ..price = json['price'] as String - ..available = json['available'] as bool - ..details = json['details'] == null - ? null - : ProductData.fromJson(json['details'] as Map); -} - -Map _$ProductToJson(Product instance) => { - 'id': instance.id, - 'averageRating': instance.averageRating, - 'price': instance.price, - 'available': instance.available, - 'details': instance.details?.toJson(), - }; - -ProductData _$ProductDataFromJson(Map json) { - return ProductData() - ..name = json['name'] as String - ..sku = json['sku'] as String - ..description = json['description'] as String - ..cover = json['cover'] == null - ? null - : Media.fromJson(json['cover'] as Map) - ..unit = json['unit'] == null - ? null - : Unit.fromJson(json['unit'] as Map) - ..media = (json['media'] as List) - ?.map( - (e) => e == null ? null : Media.fromJson(e as Map)) - ?.toList() - ..category = json['category'] == null - ? null - : Category.fromJson(json['category'] as Map); -} - -Map _$ProductDataToJson(ProductData instance) => - { - 'name': instance.name, - 'sku': instance.sku, - 'description': instance.description, - 'cover': instance.cover?.toJson(), - 'unit': instance.unit?.toJson(), - 'media': instance.media?.map((e) => e?.toJson())?.toList(), - 'category': instance.category?.toJson(), - }; - -Media _$MediaFromJson(Map json) { - return Media()..url = json['url'] as String; -} - -Map _$MediaToJson(Media instance) => { - 'url': instance.url, - }; - -Unit _$UnitFromJson(Map json) { - return Unit() - ..id = json['id'] as String - ..name = json['name'] as String; -} - -Map _$UnitToJson(Unit instance) => { - 'id': instance.id, - 'name': instance.name, - }; - -Category _$CategoryFromJson(Map json) { - return Category()..id = json['id'] as String; -} - -Map _$CategoryToJson(Category instance) => { - 'id': instance.id, - }; - -ShippingFees _$ShippingFeesFromJson(Map json) { - return ShippingFees()..shippingFees = json['shippingFees'] as String; -} - -Map _$ShippingFeesToJson(ShippingFees instance) => - { - 'shippingFees': instance.shippingFees, - }; - -ShippingFeesArguments _$ShippingFeesArgumentsFromJson( - Map json) { - return ShippingFeesArguments( - addressId: json['addressId'] as String, - voucherId: json['voucherId'] as String, - ); -} - -Map _$ShippingFeesArgumentsToJson( - ShippingFeesArguments instance) => - { - 'addressId': instance.addressId, - 'voucherId': instance.voucherId, - }; diff --git a/lib/generatedql/cart/graphql_api.graphql.dart b/lib/generatedql/cart/graphql_api.graphql.dart new file mode 100644 index 0000000..8c78478 --- /dev/null +++ b/lib/generatedql/cart/graphql_api.graphql.dart @@ -0,0 +1,635 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +import 'package:meta/meta.dart'; +import 'package:artemis/artemis.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:equatable/equatable.dart'; +import 'package:gql/ast.dart'; +part 'graphql_api.graphql.g.dart'; + +mixin ProductMixin { + String id; + String averageRating; + String price; + bool available; + ProductMixin$ProductData details; +} + +@JsonSerializable(explicitToJson: true) +class AddToCart$Mutation with EquatableMixin { + AddToCart$Mutation(); + + factory AddToCart$Mutation.fromJson(Map json) => + _$AddToCart$MutationFromJson(json); + + bool addToCart; + + @override + List get props => [addToCart]; + Map toJson() => _$AddToCart$MutationToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GetVoucherByCode$Query$Voucher with EquatableMixin { + GetVoucherByCode$Query$Voucher(); + + factory GetVoucherByCode$Query$Voucher.fromJson(Map json) => + _$GetVoucherByCode$Query$VoucherFromJson(json); + + String id; + + String code; + + int discount; + + @JsonKey(name: 'discount_type') + String discountType; + + @override + List get props => [id, code, discount, discountType]; + Map toJson() => _$GetVoucherByCode$Query$VoucherToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GetVoucherByCode$Query with EquatableMixin { + GetVoucherByCode$Query(); + + factory GetVoucherByCode$Query.fromJson(Map json) => + _$GetVoucherByCode$QueryFromJson(json); + + GetVoucherByCode$Query$Voucher getVoucherByCode; + + @override + List get props => [getVoucherByCode]; + Map toJson() => _$GetVoucherByCode$QueryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GetCart$Query$Cart$CartItem$Product with EquatableMixin, ProductMixin { + GetCart$Query$Cart$CartItem$Product(); + + factory GetCart$Query$Cart$CartItem$Product.fromJson( + Map json) => + _$GetCart$Query$Cart$CartItem$ProductFromJson(json); + + @override + List get props => [id, averageRating, price, available, details]; + Map toJson() => + _$GetCart$Query$Cart$CartItem$ProductToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GetCart$Query$Cart$CartItem with EquatableMixin { + GetCart$Query$Cart$CartItem(); + + factory GetCart$Query$Cart$CartItem.fromJson(Map json) => + _$GetCart$Query$Cart$CartItemFromJson(json); + + bool available; + + int quantity; + + GetCart$Query$Cart$CartItem$Product product; + + @override + List get props => [available, quantity, product]; + Map toJson() => _$GetCart$Query$Cart$CartItemToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GetCart$Query$Cart with EquatableMixin { + GetCart$Query$Cart(); + + factory GetCart$Query$Cart.fromJson(Map json) => + _$GetCart$Query$CartFromJson(json); + + String total; + + List items; + + @override + List get props => [total, items]; + Map toJson() => _$GetCart$Query$CartToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class GetCart$Query with EquatableMixin { + GetCart$Query(); + + factory GetCart$Query.fromJson(Map json) => + _$GetCart$QueryFromJson(json); + + GetCart$Query$Cart cart; + + @override + List get props => [cart]; + Map toJson() => _$GetCart$QueryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ProductMixin$ProductData$Media with EquatableMixin { + ProductMixin$ProductData$Media(); + + factory ProductMixin$ProductData$Media.fromJson(Map json) => + _$ProductMixin$ProductData$MediaFromJson(json); + + String url; + + @override + List get props => [url]; + Map toJson() => _$ProductMixin$ProductData$MediaToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ProductMixin$ProductData$Unit with EquatableMixin { + ProductMixin$ProductData$Unit(); + + factory ProductMixin$ProductData$Unit.fromJson(Map json) => + _$ProductMixin$ProductData$UnitFromJson(json); + + String id; + + String name; + + @override + List get props => [id, name]; + Map toJson() => _$ProductMixin$ProductData$UnitToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ProductMixin$ProductData$Category with EquatableMixin { + ProductMixin$ProductData$Category(); + + factory ProductMixin$ProductData$Category.fromJson( + Map json) => + _$ProductMixin$ProductData$CategoryFromJson(json); + + String id; + + @override + List get props => [id]; + Map toJson() => + _$ProductMixin$ProductData$CategoryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ProductMixin$ProductData with EquatableMixin { + ProductMixin$ProductData(); + + factory ProductMixin$ProductData.fromJson(Map json) => + _$ProductMixin$ProductDataFromJson(json); + + String name; + + String sku; + + String description; + + ProductMixin$ProductData$Media cover; + + ProductMixin$ProductData$Unit unit; + + List media; + + ProductMixin$ProductData$Category category; + + @override + List get props => + [name, sku, description, cover, unit, media, category]; + Map toJson() => _$ProductMixin$ProductDataToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ShippingFees$Query with EquatableMixin { + ShippingFees$Query(); + + factory ShippingFees$Query.fromJson(Map json) => + _$ShippingFees$QueryFromJson(json); + + String shippingFees; + + @override + List get props => [shippingFees]; + Map toJson() => _$ShippingFees$QueryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class AddToCartArguments extends JsonSerializable with EquatableMixin { + AddToCartArguments({@required this.productId, @required this.quantity}); + + @override + factory AddToCartArguments.fromJson(Map json) => + _$AddToCartArgumentsFromJson(json); + + final String productId; + + final int quantity; + + @override + List get props => [productId, quantity]; + @override + Map toJson() => _$AddToCartArgumentsToJson(this); +} + +class AddToCartMutation + extends GraphQLQuery { + AddToCartMutation({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'AddToCart'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'productId')), + type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'quantity')), + type: + NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'addToCart'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'items'), + value: ObjectValueNode(fields: [ + ObjectFieldNode( + name: NameNode(value: 'product_id'), + value: + VariableNode(name: NameNode(value: 'productId'))), + ObjectFieldNode( + name: NameNode(value: 'quantity'), + value: + VariableNode(name: NameNode(value: 'quantity'))) + ])) + ], + directives: [], + selectionSet: null) + ])) + ]); + + @override + final String operationName = 'AddToCart'; + + @override + final AddToCartArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + AddToCart$Mutation parse(Map json) => + AddToCart$Mutation.fromJson(json); +} + +@JsonSerializable(explicitToJson: true) +class GetVoucherByCodeArguments extends JsonSerializable with EquatableMixin { + GetVoucherByCodeArguments({@required this.code}); + + @override + factory GetVoucherByCodeArguments.fromJson(Map json) => + _$GetVoucherByCodeArgumentsFromJson(json); + + final String code; + + @override + List get props => [code]; + @override + Map toJson() => _$GetVoucherByCodeArgumentsToJson(this); +} + +class GetVoucherByCodeQuery + extends GraphQLQuery { + GetVoucherByCodeQuery({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'GetVoucherByCode'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'code')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'getVoucherByCode'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'code'), + value: VariableNode(name: NameNode(value: 'code'))) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'code'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'discount'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'discount_type'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ]); + + @override + final String operationName = 'GetVoucherByCode'; + + @override + final GetVoucherByCodeArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + GetVoucherByCode$Query parse(Map json) => + GetVoucherByCode$Query.fromJson(json); +} + +class GetCartQuery extends GraphQLQuery { + GetCartQuery(); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'GetCart'), + variableDefinitions: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'cart'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'total'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'items'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'available'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'quantity'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'product'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'Product'), + directives: []) + ])) + ])) + ])) + ])), + FragmentDefinitionNode( + name: NameNode(value: 'Product'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'Product'), isNonNull: false)), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'averageRating'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'price'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'available'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'details'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'sku'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'description'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'cover'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'url'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'unit'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'media'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'url'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'category'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ])) + ]); + + @override + final String operationName = 'GetCart'; + + @override + List get props => [document, operationName]; + @override + GetCart$Query parse(Map json) => + GetCart$Query.fromJson(json); +} + +@JsonSerializable(explicitToJson: true) +class ShippingFeesArguments extends JsonSerializable with EquatableMixin { + ShippingFeesArguments({@required this.addressId, this.voucherId}); + + @override + factory ShippingFeesArguments.fromJson(Map json) => + _$ShippingFeesArgumentsFromJson(json); + + final String addressId; + + final String voucherId; + + @override + List get props => [addressId, voucherId]; + @override + Map toJson() => _$ShippingFeesArgumentsToJson(this); +} + +class ShippingFeesQuery + extends GraphQLQuery { + ShippingFeesQuery({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'ShippingFees'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'addressId')), + type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'voucherId')), + type: + NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: false), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'shippingFees'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'input'), + value: ObjectValueNode(fields: [ + ObjectFieldNode( + name: NameNode(value: 'address_id'), + value: + VariableNode(name: NameNode(value: 'addressId'))), + ObjectFieldNode( + name: NameNode(value: 'voucher_id'), + value: + VariableNode(name: NameNode(value: 'voucherId'))) + ])) + ], + directives: [], + selectionSet: null) + ])) + ]); + + @override + final String operationName = 'ShippingFees'; + + @override + final ShippingFeesArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + ShippingFees$Query parse(Map json) => + ShippingFees$Query.fromJson(json); +} diff --git a/lib/generatedql/cart/graphql_api.graphql.g.dart b/lib/generatedql/cart/graphql_api.graphql.g.dart new file mode 100644 index 0000000..dd8a9b7 --- /dev/null +++ b/lib/generatedql/cart/graphql_api.graphql.g.dart @@ -0,0 +1,243 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'graphql_api.graphql.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AddToCart$Mutation _$AddToCart$MutationFromJson(Map json) { + return AddToCart$Mutation()..addToCart = json['addToCart'] as bool; +} + +Map _$AddToCart$MutationToJson(AddToCart$Mutation instance) => + { + 'addToCart': instance.addToCart, + }; + +GetVoucherByCode$Query$Voucher _$GetVoucherByCode$Query$VoucherFromJson( + Map json) { + return GetVoucherByCode$Query$Voucher() + ..id = json['id'] as String + ..code = json['code'] as String + ..discount = json['discount'] as int + ..discountType = json['discount_type'] as String; +} + +Map _$GetVoucherByCode$Query$VoucherToJson( + GetVoucherByCode$Query$Voucher instance) => + { + 'id': instance.id, + 'code': instance.code, + 'discount': instance.discount, + 'discount_type': instance.discountType, + }; + +GetVoucherByCode$Query _$GetVoucherByCode$QueryFromJson( + Map json) { + return GetVoucherByCode$Query() + ..getVoucherByCode = json['getVoucherByCode'] == null + ? null + : GetVoucherByCode$Query$Voucher.fromJson( + json['getVoucherByCode'] as Map); +} + +Map _$GetVoucherByCode$QueryToJson( + GetVoucherByCode$Query instance) => + { + 'getVoucherByCode': instance.getVoucherByCode?.toJson(), + }; + +GetCart$Query$Cart$CartItem$Product + _$GetCart$Query$Cart$CartItem$ProductFromJson(Map json) { + return GetCart$Query$Cart$CartItem$Product() + ..id = json['id'] as String + ..averageRating = json['averageRating'] as String + ..price = json['price'] as String + ..available = json['available'] as bool + ..details = json['details'] == null + ? null + : ProductMixin$ProductData.fromJson( + json['details'] as Map); +} + +Map _$GetCart$Query$Cart$CartItem$ProductToJson( + GetCart$Query$Cart$CartItem$Product instance) => + { + 'id': instance.id, + 'averageRating': instance.averageRating, + 'price': instance.price, + 'available': instance.available, + 'details': instance.details?.toJson(), + }; + +GetCart$Query$Cart$CartItem _$GetCart$Query$Cart$CartItemFromJson( + Map json) { + return GetCart$Query$Cart$CartItem() + ..available = json['available'] as bool + ..quantity = json['quantity'] as int + ..product = json['product'] == null + ? null + : GetCart$Query$Cart$CartItem$Product.fromJson( + json['product'] as Map); +} + +Map _$GetCart$Query$Cart$CartItemToJson( + GetCart$Query$Cart$CartItem instance) => + { + 'available': instance.available, + 'quantity': instance.quantity, + 'product': instance.product?.toJson(), + }; + +GetCart$Query$Cart _$GetCart$Query$CartFromJson(Map json) { + return GetCart$Query$Cart() + ..total = json['total'] as String + ..items = (json['items'] as List) + ?.map((e) => e == null + ? null + : GetCart$Query$Cart$CartItem.fromJson(e as Map)) + ?.toList(); +} + +Map _$GetCart$Query$CartToJson(GetCart$Query$Cart instance) => + { + 'total': instance.total, + 'items': instance.items?.map((e) => e?.toJson())?.toList(), + }; + +GetCart$Query _$GetCart$QueryFromJson(Map json) { + return GetCart$Query() + ..cart = json['cart'] == null + ? null + : GetCart$Query$Cart.fromJson(json['cart'] as Map); +} + +Map _$GetCart$QueryToJson(GetCart$Query instance) => + { + 'cart': instance.cart?.toJson(), + }; + +ProductMixin$ProductData$Media _$ProductMixin$ProductData$MediaFromJson( + Map json) { + return ProductMixin$ProductData$Media()..url = json['url'] as String; +} + +Map _$ProductMixin$ProductData$MediaToJson( + ProductMixin$ProductData$Media instance) => + { + 'url': instance.url, + }; + +ProductMixin$ProductData$Unit _$ProductMixin$ProductData$UnitFromJson( + Map json) { + return ProductMixin$ProductData$Unit() + ..id = json['id'] as String + ..name = json['name'] as String; +} + +Map _$ProductMixin$ProductData$UnitToJson( + ProductMixin$ProductData$Unit instance) => + { + 'id': instance.id, + 'name': instance.name, + }; + +ProductMixin$ProductData$Category _$ProductMixin$ProductData$CategoryFromJson( + Map json) { + return ProductMixin$ProductData$Category()..id = json['id'] as String; +} + +Map _$ProductMixin$ProductData$CategoryToJson( + ProductMixin$ProductData$Category instance) => + { + 'id': instance.id, + }; + +ProductMixin$ProductData _$ProductMixin$ProductDataFromJson( + Map json) { + return ProductMixin$ProductData() + ..name = json['name'] as String + ..sku = json['sku'] as String + ..description = json['description'] as String + ..cover = json['cover'] == null + ? null + : ProductMixin$ProductData$Media.fromJson( + json['cover'] as Map) + ..unit = json['unit'] == null + ? null + : ProductMixin$ProductData$Unit.fromJson( + json['unit'] as Map) + ..media = (json['media'] as List) + ?.map((e) => e == null + ? null + : ProductMixin$ProductData$Media.fromJson( + e as Map)) + ?.toList() + ..category = json['category'] == null + ? null + : ProductMixin$ProductData$Category.fromJson( + json['category'] as Map); +} + +Map _$ProductMixin$ProductDataToJson( + ProductMixin$ProductData instance) => + { + 'name': instance.name, + 'sku': instance.sku, + 'description': instance.description, + 'cover': instance.cover?.toJson(), + 'unit': instance.unit?.toJson(), + 'media': instance.media?.map((e) => e?.toJson())?.toList(), + 'category': instance.category?.toJson(), + }; + +ShippingFees$Query _$ShippingFees$QueryFromJson(Map json) { + return ShippingFees$Query()..shippingFees = json['shippingFees'] as String; +} + +Map _$ShippingFees$QueryToJson(ShippingFees$Query instance) => + { + 'shippingFees': instance.shippingFees, + }; + +AddToCartArguments _$AddToCartArgumentsFromJson(Map json) { + return AddToCartArguments( + productId: json['productId'] as String, + quantity: json['quantity'] as int, + ); +} + +Map _$AddToCartArgumentsToJson(AddToCartArguments instance) => + { + 'productId': instance.productId, + 'quantity': instance.quantity, + }; + +GetVoucherByCodeArguments _$GetVoucherByCodeArgumentsFromJson( + Map json) { + return GetVoucherByCodeArguments( + code: json['code'] as String, + ); +} + +Map _$GetVoucherByCodeArgumentsToJson( + GetVoucherByCodeArguments instance) => + { + 'code': instance.code, + }; + +ShippingFeesArguments _$ShippingFeesArgumentsFromJson( + Map json) { + return ShippingFeesArguments( + addressId: json['addressId'] as String, + voucherId: json['voucherId'] as String, + ); +} + +Map _$ShippingFeesArgumentsToJson( + ShippingFeesArguments instance) => + { + 'addressId': instance.addressId, + 'voucherId': instance.voucherId, + }; diff --git a/lib/generatedql/categories/graphql_api.dart b/lib/generatedql/categories/graphql_api.dart index 7ee559c..196c5cd 100644 --- a/lib/generatedql/categories/graphql_api.dart +++ b/lib/generatedql/categories/graphql_api.dart @@ -1,107 +1,2 @@ // GENERATED CODE - DO NOT MODIFY BY HAND - -import 'package:artemis/artemis.dart'; -import 'package:json_annotation/json_annotation.dart'; -import 'package:equatable/equatable.dart'; -import 'package:gql/ast.dart'; -part 'graphql_api.g.dart'; - -@JsonSerializable(explicitToJson: true) -class Categories with EquatableMixin { - Categories(); - - factory Categories.fromJson(Map json) => - _$CategoriesFromJson(json); - - List categories; - - @override - List get props => [categories]; - Map toJson() => _$CategoriesToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Category with EquatableMixin { - Category(); - - factory Category.fromJson(Map json) => - _$CategoryFromJson(json); - - String id; - - String name; - - Media cover; - - @override - List get props => [id, name, cover]; - Map toJson() => _$CategoryToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Media with EquatableMixin { - Media(); - - factory Media.fromJson(Map json) => _$MediaFromJson(json); - - String url; - - @override - List get props => [url]; - Map toJson() => _$MediaToJson(this); -} - -class CategoriesQuery extends GraphQLQuery { - CategoriesQuery(); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'Categories'), - variableDefinitions: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'categories'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'cover'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'url'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ])) - ]); - - @override - final String operationName = 'Categories'; - - @override - List get props => [document, operationName]; - @override - Categories parse(Map json) => Categories.fromJson(json); -} +export 'graphql_api.graphql.dart'; diff --git a/lib/generatedql/categories/graphql_api.g.dart b/lib/generatedql/categories/graphql_api.g.dart deleted file mode 100644 index 7278bd5..0000000 --- a/lib/generatedql/categories/graphql_api.g.dart +++ /dev/null @@ -1,43 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'graphql_api.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -Categories _$CategoriesFromJson(Map json) { - return Categories() - ..categories = (json['categories'] as List) - ?.map((e) => - e == null ? null : Category.fromJson(e as Map)) - ?.toList(); -} - -Map _$CategoriesToJson(Categories instance) => - { - 'categories': instance.categories?.map((e) => e?.toJson())?.toList(), - }; - -Category _$CategoryFromJson(Map json) { - return Category() - ..id = json['id'] as String - ..name = json['name'] as String - ..cover = json['cover'] == null - ? null - : Media.fromJson(json['cover'] as Map); -} - -Map _$CategoryToJson(Category instance) => { - 'id': instance.id, - 'name': instance.name, - 'cover': instance.cover?.toJson(), - }; - -Media _$MediaFromJson(Map json) { - return Media()..url = json['url'] as String; -} - -Map _$MediaToJson(Media instance) => { - 'url': instance.url, - }; diff --git a/lib/generatedql/categories/graphql_api.graphql.dart b/lib/generatedql/categories/graphql_api.graphql.dart new file mode 100644 index 0000000..6f8b342 --- /dev/null +++ b/lib/generatedql/categories/graphql_api.graphql.dart @@ -0,0 +1,110 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +import 'package:artemis/artemis.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:equatable/equatable.dart'; +import 'package:gql/ast.dart'; +part 'graphql_api.graphql.g.dart'; + +@JsonSerializable(explicitToJson: true) +class Categories$Query$Category$Media with EquatableMixin { + Categories$Query$Category$Media(); + + factory Categories$Query$Category$Media.fromJson(Map json) => + _$Categories$Query$Category$MediaFromJson(json); + + String url; + + @override + List get props => [url]; + Map toJson() => + _$Categories$Query$Category$MediaToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Categories$Query$Category with EquatableMixin { + Categories$Query$Category(); + + factory Categories$Query$Category.fromJson(Map json) => + _$Categories$Query$CategoryFromJson(json); + + String id; + + String name; + + Categories$Query$Category$Media cover; + + @override + List get props => [id, name, cover]; + Map toJson() => _$Categories$Query$CategoryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Categories$Query with EquatableMixin { + Categories$Query(); + + factory Categories$Query.fromJson(Map json) => + _$Categories$QueryFromJson(json); + + List categories; + + @override + List get props => [categories]; + Map toJson() => _$Categories$QueryToJson(this); +} + +class CategoriesQuery extends GraphQLQuery { + CategoriesQuery(); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'Categories'), + variableDefinitions: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'categories'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'cover'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'url'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ])) + ]); + + @override + final String operationName = 'Categories'; + + @override + List get props => [document, operationName]; + @override + Categories$Query parse(Map json) => + Categories$Query.fromJson(json); +} diff --git a/lib/generatedql/categories/graphql_api.graphql.g.dart b/lib/generatedql/categories/graphql_api.graphql.g.dart new file mode 100644 index 0000000..63c5e98 --- /dev/null +++ b/lib/generatedql/categories/graphql_api.graphql.g.dart @@ -0,0 +1,51 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'graphql_api.graphql.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Categories$Query$Category$Media _$Categories$Query$Category$MediaFromJson( + Map json) { + return Categories$Query$Category$Media()..url = json['url'] as String; +} + +Map _$Categories$Query$Category$MediaToJson( + Categories$Query$Category$Media instance) => + { + 'url': instance.url, + }; + +Categories$Query$Category _$Categories$Query$CategoryFromJson( + Map json) { + return Categories$Query$Category() + ..id = json['id'] as String + ..name = json['name'] as String + ..cover = json['cover'] == null + ? null + : Categories$Query$Category$Media.fromJson( + json['cover'] as Map); +} + +Map _$Categories$Query$CategoryToJson( + Categories$Query$Category instance) => + { + 'id': instance.id, + 'name': instance.name, + 'cover': instance.cover?.toJson(), + }; + +Categories$Query _$Categories$QueryFromJson(Map json) { + return Categories$Query() + ..categories = (json['categories'] as List) + ?.map((e) => e == null + ? null + : Categories$Query$Category.fromJson(e as Map)) + ?.toList(); +} + +Map _$Categories$QueryToJson(Categories$Query instance) => + { + 'categories': instance.categories?.map((e) => e?.toJson())?.toList(), + }; diff --git a/lib/generatedql/general/graphql_api.dart b/lib/generatedql/general/graphql_api.dart index fa08337..196c5cd 100644 --- a/lib/generatedql/general/graphql_api.dart +++ b/lib/generatedql/general/graphql_api.dart @@ -1,272 +1,2 @@ // GENERATED CODE - DO NOT MODIFY BY HAND - -import 'package:artemis/artemis.dart'; -import 'package:json_annotation/json_annotation.dart'; -import 'package:equatable/equatable.dart'; -import 'package:gql/ast.dart'; -part 'graphql_api.g.dart'; - -@JsonSerializable(explicitToJson: true) -class Attributes with EquatableMixin { - Attributes(); - - factory Attributes.fromJson(Map json) => - _$AttributesFromJson(json); - - List attributes; - - @override - List get props => [attributes]; - Map toJson() => _$AttributesToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Attribute with EquatableMixin { - Attribute(); - - factory Attribute.fromJson(Map json) => - _$AttributeFromJson(json); - - String id; - - String name; - - List options; - - @override - List get props => [id, name, options]; - Map toJson() => _$AttributeToJson(this); -} - -class AttributesQuery extends GraphQLQuery { - AttributesQuery(); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'Attributes'), - variableDefinitions: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'attributes'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'options'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ]); - - @override - final String operationName = 'Attributes'; - - @override - List get props => [document, operationName]; - @override - Attributes parse(Map json) => Attributes.fromJson(json); -} - -@JsonSerializable(explicitToJson: true) -class Brands with EquatableMixin { - Brands(); - - factory Brands.fromJson(Map json) => _$BrandsFromJson(json); - - List brands; - - @override - List get props => [brands]; - Map toJson() => _$BrandsToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Brand with EquatableMixin { - Brand(); - - factory Brand.fromJson(Map json) => _$BrandFromJson(json); - - String id; - - String name; - - @override - List get props => [id, name]; - Map toJson() => _$BrandToJson(this); -} - -class BrandsQuery extends GraphQLQuery { - BrandsQuery(); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'Brands'), - variableDefinitions: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'brands'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ]); - - @override - final String operationName = 'Brands'; - - @override - List get props => [document, operationName]; - @override - Brands parse(Map json) => Brands.fromJson(json); -} - -@JsonSerializable(explicitToJson: true) -class Sliders with EquatableMixin { - Sliders(); - - factory Sliders.fromJson(Map json) => - _$SlidersFromJson(json); - - List sliders; - - @override - List get props => [sliders]; - Map toJson() => _$SlidersToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Slider with EquatableMixin { - Slider(); - - factory Slider.fromJson(Map json) => _$SliderFromJson(json); - - String id; - - String title; - - String description; - - String link; - - Media cover; - - @override - List get props => [id, title, description, link, cover]; - Map toJson() => _$SliderToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Media with EquatableMixin { - Media(); - - factory Media.fromJson(Map json) => _$MediaFromJson(json); - - String url; - - @override - List get props => [url]; - Map toJson() => _$MediaToJson(this); -} - -class SlidersQuery extends GraphQLQuery { - SlidersQuery(); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'Sliders'), - variableDefinitions: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'sliders'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'title'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'description'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'link'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'cover'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'url'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ])) - ]); - - @override - final String operationName = 'Sliders'; - - @override - List get props => [document, operationName]; - @override - Sliders parse(Map json) => Sliders.fromJson(json); -} +export 'graphql_api.graphql.dart'; diff --git a/lib/generatedql/general/graphql_api.g.dart b/lib/generatedql/general/graphql_api.g.dart deleted file mode 100644 index 36231a3..0000000 --- a/lib/generatedql/general/graphql_api.g.dart +++ /dev/null @@ -1,95 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'graphql_api.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -Attributes _$AttributesFromJson(Map json) { - return Attributes() - ..attributes = (json['attributes'] as List) - ?.map((e) => - e == null ? null : Attribute.fromJson(e as Map)) - ?.toList(); -} - -Map _$AttributesToJson(Attributes instance) => - { - 'attributes': instance.attributes?.map((e) => e?.toJson())?.toList(), - }; - -Attribute _$AttributeFromJson(Map json) { - return Attribute() - ..id = json['id'] as String - ..name = json['name'] as String - ..options = (json['options'] as List)?.map((e) => e as String)?.toList(); -} - -Map _$AttributeToJson(Attribute instance) => { - 'id': instance.id, - 'name': instance.name, - 'options': instance.options, - }; - -Brands _$BrandsFromJson(Map json) { - return Brands() - ..brands = (json['brands'] as List) - ?.map( - (e) => e == null ? null : Brand.fromJson(e as Map)) - ?.toList(); -} - -Map _$BrandsToJson(Brands instance) => { - 'brands': instance.brands?.map((e) => e?.toJson())?.toList(), - }; - -Brand _$BrandFromJson(Map json) { - return Brand() - ..id = json['id'] as String - ..name = json['name'] as String; -} - -Map _$BrandToJson(Brand instance) => { - 'id': instance.id, - 'name': instance.name, - }; - -Sliders _$SlidersFromJson(Map json) { - return Sliders() - ..sliders = (json['sliders'] as List) - ?.map((e) => - e == null ? null : Slider.fromJson(e as Map)) - ?.toList(); -} - -Map _$SlidersToJson(Sliders instance) => { - 'sliders': instance.sliders?.map((e) => e?.toJson())?.toList(), - }; - -Slider _$SliderFromJson(Map json) { - return Slider() - ..id = json['id'] as String - ..title = json['title'] as String - ..description = json['description'] as String - ..link = json['link'] as String - ..cover = json['cover'] == null - ? null - : Media.fromJson(json['cover'] as Map); -} - -Map _$SliderToJson(Slider instance) => { - 'id': instance.id, - 'title': instance.title, - 'description': instance.description, - 'link': instance.link, - 'cover': instance.cover?.toJson(), - }; - -Media _$MediaFromJson(Map json) { - return Media()..url = json['url'] as String; -} - -Map _$MediaToJson(Media instance) => { - 'url': instance.url, - }; diff --git a/lib/generatedql/general/graphql_api.graphql.dart b/lib/generatedql/general/graphql_api.graphql.dart new file mode 100644 index 0000000..5b09fbe --- /dev/null +++ b/lib/generatedql/general/graphql_api.graphql.dart @@ -0,0 +1,278 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +import 'package:artemis/artemis.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:equatable/equatable.dart'; +import 'package:gql/ast.dart'; +part 'graphql_api.graphql.g.dart'; + +@JsonSerializable(explicitToJson: true) +class Sliders$Query$Slider$Media with EquatableMixin { + Sliders$Query$Slider$Media(); + + factory Sliders$Query$Slider$Media.fromJson(Map json) => + _$Sliders$Query$Slider$MediaFromJson(json); + + String url; + + @override + List get props => [url]; + Map toJson() => _$Sliders$Query$Slider$MediaToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Sliders$Query$Slider with EquatableMixin { + Sliders$Query$Slider(); + + factory Sliders$Query$Slider.fromJson(Map json) => + _$Sliders$Query$SliderFromJson(json); + + String id; + + String title; + + String description; + + String link; + + Sliders$Query$Slider$Media cover; + + @override + List get props => [id, title, description, link, cover]; + Map toJson() => _$Sliders$Query$SliderToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Sliders$Query with EquatableMixin { + Sliders$Query(); + + factory Sliders$Query.fromJson(Map json) => + _$Sliders$QueryFromJson(json); + + List sliders; + + @override + List get props => [sliders]; + Map toJson() => _$Sliders$QueryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Attributes$Query$Attribute with EquatableMixin { + Attributes$Query$Attribute(); + + factory Attributes$Query$Attribute.fromJson(Map json) => + _$Attributes$Query$AttributeFromJson(json); + + String id; + + String name; + + List options; + + @override + List get props => [id, name, options]; + Map toJson() => _$Attributes$Query$AttributeToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Attributes$Query with EquatableMixin { + Attributes$Query(); + + factory Attributes$Query.fromJson(Map json) => + _$Attributes$QueryFromJson(json); + + List attributes; + + @override + List get props => [attributes]; + Map toJson() => _$Attributes$QueryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Brands$Query$Brand with EquatableMixin { + Brands$Query$Brand(); + + factory Brands$Query$Brand.fromJson(Map json) => + _$Brands$Query$BrandFromJson(json); + + String id; + + String name; + + @override + List get props => [id, name]; + Map toJson() => _$Brands$Query$BrandToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Brands$Query with EquatableMixin { + Brands$Query(); + + factory Brands$Query.fromJson(Map json) => + _$Brands$QueryFromJson(json); + + List brands; + + @override + List get props => [brands]; + Map toJson() => _$Brands$QueryToJson(this); +} + +class SlidersQuery extends GraphQLQuery { + SlidersQuery(); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'Sliders'), + variableDefinitions: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'sliders'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'title'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'description'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'link'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'cover'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'url'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ])) + ]); + + @override + final String operationName = 'Sliders'; + + @override + List get props => [document, operationName]; + @override + Sliders$Query parse(Map json) => + Sliders$Query.fromJson(json); +} + +class AttributesQuery extends GraphQLQuery { + AttributesQuery(); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'Attributes'), + variableDefinitions: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'attributes'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'options'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ]); + + @override + final String operationName = 'Attributes'; + + @override + List get props => [document, operationName]; + @override + Attributes$Query parse(Map json) => + Attributes$Query.fromJson(json); +} + +class BrandsQuery extends GraphQLQuery { + BrandsQuery(); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'Brands'), + variableDefinitions: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'brands'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ]); + + @override + final String operationName = 'Brands'; + + @override + List get props => [document, operationName]; + @override + Brands$Query parse(Map json) => Brands$Query.fromJson(json); +} diff --git a/lib/generatedql/general/graphql_api.graphql.g.dart b/lib/generatedql/general/graphql_api.graphql.g.dart new file mode 100644 index 0000000..6c8edf8 --- /dev/null +++ b/lib/generatedql/general/graphql_api.graphql.g.dart @@ -0,0 +1,110 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'graphql_api.graphql.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Sliders$Query$Slider$Media _$Sliders$Query$Slider$MediaFromJson( + Map json) { + return Sliders$Query$Slider$Media()..url = json['url'] as String; +} + +Map _$Sliders$Query$Slider$MediaToJson( + Sliders$Query$Slider$Media instance) => + { + 'url': instance.url, + }; + +Sliders$Query$Slider _$Sliders$Query$SliderFromJson(Map json) { + return Sliders$Query$Slider() + ..id = json['id'] as String + ..title = json['title'] as String + ..description = json['description'] as String + ..link = json['link'] as String + ..cover = json['cover'] == null + ? null + : Sliders$Query$Slider$Media.fromJson( + json['cover'] as Map); +} + +Map _$Sliders$Query$SliderToJson( + Sliders$Query$Slider instance) => + { + 'id': instance.id, + 'title': instance.title, + 'description': instance.description, + 'link': instance.link, + 'cover': instance.cover?.toJson(), + }; + +Sliders$Query _$Sliders$QueryFromJson(Map json) { + return Sliders$Query() + ..sliders = (json['sliders'] as List) + ?.map((e) => e == null + ? null + : Sliders$Query$Slider.fromJson(e as Map)) + ?.toList(); +} + +Map _$Sliders$QueryToJson(Sliders$Query instance) => + { + 'sliders': instance.sliders?.map((e) => e?.toJson())?.toList(), + }; + +Attributes$Query$Attribute _$Attributes$Query$AttributeFromJson( + Map json) { + return Attributes$Query$Attribute() + ..id = json['id'] as String + ..name = json['name'] as String + ..options = (json['options'] as List)?.map((e) => e as String)?.toList(); +} + +Map _$Attributes$Query$AttributeToJson( + Attributes$Query$Attribute instance) => + { + 'id': instance.id, + 'name': instance.name, + 'options': instance.options, + }; + +Attributes$Query _$Attributes$QueryFromJson(Map json) { + return Attributes$Query() + ..attributes = (json['attributes'] as List) + ?.map((e) => e == null + ? null + : Attributes$Query$Attribute.fromJson(e as Map)) + ?.toList(); +} + +Map _$Attributes$QueryToJson(Attributes$Query instance) => + { + 'attributes': instance.attributes?.map((e) => e?.toJson())?.toList(), + }; + +Brands$Query$Brand _$Brands$Query$BrandFromJson(Map json) { + return Brands$Query$Brand() + ..id = json['id'] as String + ..name = json['name'] as String; +} + +Map _$Brands$Query$BrandToJson(Brands$Query$Brand instance) => + { + 'id': instance.id, + 'name': instance.name, + }; + +Brands$Query _$Brands$QueryFromJson(Map json) { + return Brands$Query() + ..brands = (json['brands'] as List) + ?.map((e) => e == null + ? null + : Brands$Query$Brand.fromJson(e as Map)) + ?.toList(); +} + +Map _$Brands$QueryToJson(Brands$Query instance) => + { + 'brands': instance.brands?.map((e) => e?.toJson())?.toList(), + }; diff --git a/lib/generatedql/order_products/graphql_api.dart b/lib/generatedql/order_products/graphql_api.dart index 00c7927..196c5cd 100644 --- a/lib/generatedql/order_products/graphql_api.dart +++ b/lib/generatedql/order_products/graphql_api.dart @@ -1,494 +1,2 @@ // GENERATED CODE - DO NOT MODIFY BY HAND - -import 'package:artemis/artemis.dart'; -import 'package:json_annotation/json_annotation.dart'; -import 'package:equatable/equatable.dart'; -import 'package:gql/ast.dart'; -part 'graphql_api.g.dart'; - -mixin PagingMixin { - int count; - int currentPage; - int firstItem; - int lastItem; - bool hasMorePages; - int lastPage; - int perPage; - int total; -} -mixin ProductMixin { - String id; - String averageRating; - String price; - bool available; - ProductData details; -} - -@JsonSerializable(explicitToJson: true) -class OrderProducts with EquatableMixin { - OrderProducts(); - - factory OrderProducts.fromJson(Map json) => - _$OrderProductsFromJson(json); - - ProductPaginator products; - - @override - List get props => [products]; - Map toJson() => _$OrderProductsToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class ProductPaginator with EquatableMixin { - ProductPaginator(); - - factory ProductPaginator.fromJson(Map json) => - _$ProductPaginatorFromJson(json); - - PaginatorInfo paginatorInfo; - - List data; - - @override - List get props => [paginatorInfo, data]; - Map toJson() => _$ProductPaginatorToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class PaginatorInfo with EquatableMixin, PagingMixin { - PaginatorInfo(); - - factory PaginatorInfo.fromJson(Map json) => - _$PaginatorInfoFromJson(json); - - @override - List get props => [ - count, - currentPage, - firstItem, - lastItem, - hasMorePages, - lastPage, - perPage, - total - ]; - Map toJson() => _$PaginatorInfoToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Product with EquatableMixin, ProductMixin { - Product(); - - factory Product.fromJson(Map json) => - _$ProductFromJson(json); - - @override - List get props => [id, averageRating, price, available, details]; - Map toJson() => _$ProductToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class ProductData with EquatableMixin { - ProductData(); - - factory ProductData.fromJson(Map json) => - _$ProductDataFromJson(json); - - String name; - - String sku; - - String description; - - Media cover; - - Unit unit; - - List media; - - Category category; - - @override - List get props => - [name, sku, description, cover, unit, media, category]; - Map toJson() => _$ProductDataToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Media with EquatableMixin { - Media(); - - factory Media.fromJson(Map json) => _$MediaFromJson(json); - - String url; - - @override - List get props => [url]; - Map toJson() => _$MediaToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Unit with EquatableMixin { - Unit(); - - factory Unit.fromJson(Map json) => _$UnitFromJson(json); - - String id; - - String name; - - @override - List get props => [id, name]; - Map toJson() => _$UnitToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Category with EquatableMixin { - Category(); - - factory Category.fromJson(Map json) => - _$CategoryFromJson(json); - - String id; - - @override - List get props => [id]; - Map toJson() => _$CategoryToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class OrderProductsArguments extends JsonSerializable with EquatableMixin { - OrderProductsArguments( - {this.first, - this.page, - this.productsId, - this.catId, - this.name, - this.fieldOfOrder, - this.orderType}); - - factory OrderProductsArguments.fromJson(Map json) => - _$OrderProductsArgumentsFromJson(json); - - final int first; - - final int page; - - final String productsId; - - final List catId; - - final String name; - - final String fieldOfOrder; - - final String orderType; - - @override - List get props => - [first, page, productsId, catId, name, fieldOfOrder, orderType]; - Map toJson() => _$OrderProductsArgumentsToJson(this); -} - -class OrderProductsQuery - extends GraphQLQuery { - OrderProductsQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'OrderProducts'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'first')), - type: - NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'page')), - type: - NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'productsId')), - type: - NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: false), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'catId')), - type: ListTypeNode( - type: NamedTypeNode( - name: NameNode(value: 'ID'), isNonNull: false), - isNonNull: false), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'name')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: false), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'fieldOfOrder')), - type: NamedTypeNode( - name: NameNode(value: 'ProductsOrderByColumn'), - isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'orderType')), - type: NamedTypeNode( - name: NameNode(value: 'SortOrder'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'products'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'first'), - value: VariableNode(name: NameNode(value: 'first'))), - ArgumentNode( - name: NameNode(value: 'page'), - value: VariableNode(name: NameNode(value: 'page'))), - ArgumentNode( - name: NameNode(value: 'filter'), - value: ObjectValueNode(fields: [ - ObjectFieldNode( - name: NameNode(value: 'name'), - value: VariableNode(name: NameNode(value: 'name'))), - ObjectFieldNode( - name: NameNode(value: 'id'), - value: VariableNode( - name: NameNode(value: 'productsId'))), - ObjectFieldNode( - name: NameNode(value: 'category'), - value: VariableNode(name: NameNode(value: 'catId'))) - ])), - ArgumentNode( - name: NameNode(value: 'orderBy'), - value: ObjectValueNode(fields: [ - ObjectFieldNode( - name: NameNode(value: 'field'), - value: VariableNode( - name: NameNode(value: 'fieldOfOrder'))), - ObjectFieldNode( - name: NameNode(value: 'order'), - value: - VariableNode(name: NameNode(value: 'orderType'))) - ])) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'paginatorInfo'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FragmentSpreadNode( - name: NameNode(value: 'Paging'), directives: []) - ])), - FieldNode( - name: NameNode(value: 'data'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FragmentSpreadNode( - name: NameNode(value: 'Product'), directives: []) - ])) - ])) - ])), - FragmentDefinitionNode( - name: NameNode(value: 'Paging'), - typeCondition: TypeConditionNode( - on: NamedTypeNode( - name: NameNode(value: 'PaginatorInfo'), isNonNull: false)), - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'count'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'currentPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'firstItem'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'lastItem'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'hasMorePages'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'lastPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'perPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'total'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FragmentDefinitionNode( - name: NameNode(value: 'Product'), - typeCondition: TypeConditionNode( - on: NamedTypeNode( - name: NameNode(value: 'Product'), isNonNull: false)), - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'averageRating'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'price'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'available'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'details'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'sku'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'description'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'cover'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'url'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'unit'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'media'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'url'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'category'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ])) - ]); - - @override - final String operationName = 'OrderProducts'; - - @override - final OrderProductsArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - OrderProducts parse(Map json) => - OrderProducts.fromJson(json); -} +export 'graphql_api.graphql.dart'; diff --git a/lib/generatedql/order_products/graphql_api.g.dart b/lib/generatedql/order_products/graphql_api.g.dart deleted file mode 100644 index 0133f4f..0000000 --- a/lib/generatedql/order_products/graphql_api.g.dart +++ /dev/null @@ -1,162 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'graphql_api.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -OrderProducts _$OrderProductsFromJson(Map json) { - return OrderProducts() - ..products = json['products'] == null - ? null - : ProductPaginator.fromJson(json['products'] as Map); -} - -Map _$OrderProductsToJson(OrderProducts instance) => - { - 'products': instance.products?.toJson(), - }; - -ProductPaginator _$ProductPaginatorFromJson(Map json) { - return ProductPaginator() - ..paginatorInfo = json['paginatorInfo'] == null - ? null - : PaginatorInfo.fromJson(json['paginatorInfo'] as Map) - ..data = (json['data'] as List) - ?.map((e) => - e == null ? null : Product.fromJson(e as Map)) - ?.toList(); -} - -Map _$ProductPaginatorToJson(ProductPaginator instance) => - { - 'paginatorInfo': instance.paginatorInfo?.toJson(), - 'data': instance.data?.map((e) => e?.toJson())?.toList(), - }; - -PaginatorInfo _$PaginatorInfoFromJson(Map json) { - return PaginatorInfo() - ..count = json['count'] as int - ..currentPage = json['currentPage'] as int - ..firstItem = json['firstItem'] as int - ..lastItem = json['lastItem'] as int - ..hasMorePages = json['hasMorePages'] as bool - ..lastPage = json['lastPage'] as int - ..perPage = json['perPage'] as int - ..total = json['total'] as int; -} - -Map _$PaginatorInfoToJson(PaginatorInfo instance) => - { - 'count': instance.count, - 'currentPage': instance.currentPage, - 'firstItem': instance.firstItem, - 'lastItem': instance.lastItem, - 'hasMorePages': instance.hasMorePages, - 'lastPage': instance.lastPage, - 'perPage': instance.perPage, - 'total': instance.total, - }; - -Product _$ProductFromJson(Map json) { - return Product() - ..id = json['id'] as String - ..averageRating = json['averageRating'] as String - ..price = json['price'] as String - ..available = json['available'] as bool - ..details = json['details'] == null - ? null - : ProductData.fromJson(json['details'] as Map); -} - -Map _$ProductToJson(Product instance) => { - 'id': instance.id, - 'averageRating': instance.averageRating, - 'price': instance.price, - 'available': instance.available, - 'details': instance.details?.toJson(), - }; - -ProductData _$ProductDataFromJson(Map json) { - return ProductData() - ..name = json['name'] as String - ..sku = json['sku'] as String - ..description = json['description'] as String - ..cover = json['cover'] == null - ? null - : Media.fromJson(json['cover'] as Map) - ..unit = json['unit'] == null - ? null - : Unit.fromJson(json['unit'] as Map) - ..media = (json['media'] as List) - ?.map( - (e) => e == null ? null : Media.fromJson(e as Map)) - ?.toList() - ..category = json['category'] == null - ? null - : Category.fromJson(json['category'] as Map); -} - -Map _$ProductDataToJson(ProductData instance) => - { - 'name': instance.name, - 'sku': instance.sku, - 'description': instance.description, - 'cover': instance.cover?.toJson(), - 'unit': instance.unit?.toJson(), - 'media': instance.media?.map((e) => e?.toJson())?.toList(), - 'category': instance.category?.toJson(), - }; - -Media _$MediaFromJson(Map json) { - return Media()..url = json['url'] as String; -} - -Map _$MediaToJson(Media instance) => { - 'url': instance.url, - }; - -Unit _$UnitFromJson(Map json) { - return Unit() - ..id = json['id'] as String - ..name = json['name'] as String; -} - -Map _$UnitToJson(Unit instance) => { - 'id': instance.id, - 'name': instance.name, - }; - -Category _$CategoryFromJson(Map json) { - return Category()..id = json['id'] as String; -} - -Map _$CategoryToJson(Category instance) => { - 'id': instance.id, - }; - -OrderProductsArguments _$OrderProductsArgumentsFromJson( - Map json) { - return OrderProductsArguments( - first: json['first'] as int, - page: json['page'] as int, - productsId: json['productsId'] as String, - catId: (json['catId'] as List)?.map((e) => e as String)?.toList(), - name: json['name'] as String, - fieldOfOrder: json['fieldOfOrder'], - orderType: json['orderType'], - ); -} - -Map _$OrderProductsArgumentsToJson( - OrderProductsArguments instance) => - { - 'first': instance.first, - 'page': instance.page, - 'productsId': instance.productsId, - 'catId': instance.catId, - 'name': instance.name, - 'fieldOfOrder': instance.fieldOfOrder, - 'orderType': instance.orderType, - }; diff --git a/lib/generatedql/order_products/graphql_api.graphql.dart b/lib/generatedql/order_products/graphql_api.graphql.dart new file mode 100644 index 0000000..87fd654 --- /dev/null +++ b/lib/generatedql/order_products/graphql_api.graphql.dart @@ -0,0 +1,528 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +import 'package:meta/meta.dart'; +import 'package:artemis/artemis.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:equatable/equatable.dart'; +import 'package:gql/ast.dart'; +part 'graphql_api.graphql.g.dart'; + +mixin PagingMixin { + int count; + int currentPage; + int firstItem; + int lastItem; + bool hasMorePages; + int lastPage; + int perPage; + int total; +} +mixin ProductMixin { + String id; + String averageRating; + String price; + bool available; + ProductMixin$ProductData details; +} + +@JsonSerializable(explicitToJson: true) +class OrderProducts$Query$ProductPaginator$PaginatorInfo + with EquatableMixin, PagingMixin { + OrderProducts$Query$ProductPaginator$PaginatorInfo(); + + factory OrderProducts$Query$ProductPaginator$PaginatorInfo.fromJson( + Map json) => + _$OrderProducts$Query$ProductPaginator$PaginatorInfoFromJson(json); + + @override + List get props => [ + count, + currentPage, + firstItem, + lastItem, + hasMorePages, + lastPage, + perPage, + total + ]; + Map toJson() => + _$OrderProducts$Query$ProductPaginator$PaginatorInfoToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class OrderProducts$Query$ProductPaginator$Product + with EquatableMixin, ProductMixin { + OrderProducts$Query$ProductPaginator$Product(); + + factory OrderProducts$Query$ProductPaginator$Product.fromJson( + Map json) => + _$OrderProducts$Query$ProductPaginator$ProductFromJson(json); + + @override + List get props => [id, averageRating, price, available, details]; + Map toJson() => + _$OrderProducts$Query$ProductPaginator$ProductToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class OrderProducts$Query$ProductPaginator with EquatableMixin { + OrderProducts$Query$ProductPaginator(); + + factory OrderProducts$Query$ProductPaginator.fromJson( + Map json) => + _$OrderProducts$Query$ProductPaginatorFromJson(json); + + OrderProducts$Query$ProductPaginator$PaginatorInfo paginatorInfo; + + List data; + + @override + List get props => [paginatorInfo, data]; + Map toJson() => + _$OrderProducts$Query$ProductPaginatorToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class OrderProducts$Query with EquatableMixin { + OrderProducts$Query(); + + factory OrderProducts$Query.fromJson(Map json) => + _$OrderProducts$QueryFromJson(json); + + OrderProducts$Query$ProductPaginator products; + + @override + List get props => [products]; + Map toJson() => _$OrderProducts$QueryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ProductMixin$ProductData$Media with EquatableMixin { + ProductMixin$ProductData$Media(); + + factory ProductMixin$ProductData$Media.fromJson(Map json) => + _$ProductMixin$ProductData$MediaFromJson(json); + + String url; + + @override + List get props => [url]; + Map toJson() => _$ProductMixin$ProductData$MediaToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ProductMixin$ProductData$Unit with EquatableMixin { + ProductMixin$ProductData$Unit(); + + factory ProductMixin$ProductData$Unit.fromJson(Map json) => + _$ProductMixin$ProductData$UnitFromJson(json); + + String id; + + String name; + + @override + List get props => [id, name]; + Map toJson() => _$ProductMixin$ProductData$UnitToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ProductMixin$ProductData$Category with EquatableMixin { + ProductMixin$ProductData$Category(); + + factory ProductMixin$ProductData$Category.fromJson( + Map json) => + _$ProductMixin$ProductData$CategoryFromJson(json); + + String id; + + @override + List get props => [id]; + Map toJson() => + _$ProductMixin$ProductData$CategoryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ProductMixin$ProductData with EquatableMixin { + ProductMixin$ProductData(); + + factory ProductMixin$ProductData.fromJson(Map json) => + _$ProductMixin$ProductDataFromJson(json); + + String name; + + String sku; + + String description; + + ProductMixin$ProductData$Media cover; + + ProductMixin$ProductData$Unit unit; + + List media; + + ProductMixin$ProductData$Category category; + + @override + List get props => + [name, sku, description, cover, unit, media, category]; + Map toJson() => _$ProductMixin$ProductDataToJson(this); +} + +enum ProductsOrderByColumn { + @JsonValue('ID') + id, + @JsonValue('NAME') + name, + @JsonValue('ARTEMIS_UNKNOWN') + artemisUnknown, +} +enum SortOrder { + @JsonValue('ASC') + asc, + @JsonValue('DESC') + desc, + @JsonValue('ARTEMIS_UNKNOWN') + artemisUnknown, +} + +@JsonSerializable(explicitToJson: true) +class OrderProductsArguments extends JsonSerializable with EquatableMixin { + OrderProductsArguments( + {@required this.first, + @required this.page, + this.productsId, + this.catId, + this.name, + @required this.fieldOfOrder, + @required this.orderType}); + + @override + factory OrderProductsArguments.fromJson(Map json) => + _$OrderProductsArgumentsFromJson(json); + + final int first; + + final int page; + + final String productsId; + + final List catId; + + final String name; + + @JsonKey(unknownEnumValue: ProductsOrderByColumn.artemisUnknown) + final ProductsOrderByColumn fieldOfOrder; + + @JsonKey(unknownEnumValue: SortOrder.artemisUnknown) + final SortOrder orderType; + + @override + List get props => + [first, page, productsId, catId, name, fieldOfOrder, orderType]; + @override + Map toJson() => _$OrderProductsArgumentsToJson(this); +} + +class OrderProductsQuery + extends GraphQLQuery { + OrderProductsQuery({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'OrderProducts'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'first')), + type: + NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'page')), + type: + NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'productsId')), + type: + NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: false), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'catId')), + type: ListTypeNode( + type: NamedTypeNode( + name: NameNode(value: 'ID'), isNonNull: false), + isNonNull: false), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'name')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: false), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'fieldOfOrder')), + type: NamedTypeNode( + name: NameNode(value: 'ProductsOrderByColumn'), + isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'orderType')), + type: NamedTypeNode( + name: NameNode(value: 'SortOrder'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'products'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'first'), + value: VariableNode(name: NameNode(value: 'first'))), + ArgumentNode( + name: NameNode(value: 'page'), + value: VariableNode(name: NameNode(value: 'page'))), + ArgumentNode( + name: NameNode(value: 'filter'), + value: ObjectValueNode(fields: [ + ObjectFieldNode( + name: NameNode(value: 'name'), + value: VariableNode(name: NameNode(value: 'name'))), + ObjectFieldNode( + name: NameNode(value: 'id'), + value: VariableNode( + name: NameNode(value: 'productsId'))), + ObjectFieldNode( + name: NameNode(value: 'category'), + value: VariableNode(name: NameNode(value: 'catId'))) + ])), + ArgumentNode( + name: NameNode(value: 'orderBy'), + value: ObjectValueNode(fields: [ + ObjectFieldNode( + name: NameNode(value: 'field'), + value: VariableNode( + name: NameNode(value: 'fieldOfOrder'))), + ObjectFieldNode( + name: NameNode(value: 'order'), + value: + VariableNode(name: NameNode(value: 'orderType'))) + ])) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'paginatorInfo'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'Paging'), directives: []) + ])), + FieldNode( + name: NameNode(value: 'data'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'Product'), directives: []) + ])) + ])) + ])), + FragmentDefinitionNode( + name: NameNode(value: 'Paging'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'PaginatorInfo'), isNonNull: false)), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'count'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'currentPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'firstItem'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'lastItem'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'hasMorePages'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'lastPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'perPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'total'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FragmentDefinitionNode( + name: NameNode(value: 'Product'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'Product'), isNonNull: false)), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'averageRating'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'price'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'available'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'details'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'sku'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'description'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'cover'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'url'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'unit'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'media'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'url'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'category'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ])) + ]); + + @override + final String operationName = 'OrderProducts'; + + @override + final OrderProductsArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + OrderProducts$Query parse(Map json) => + OrderProducts$Query.fromJson(json); +} diff --git a/lib/generatedql/order_products/graphql_api.graphql.g.dart b/lib/generatedql/order_products/graphql_api.graphql.g.dart new file mode 100644 index 0000000..6d6819e --- /dev/null +++ b/lib/generatedql/order_products/graphql_api.graphql.g.dart @@ -0,0 +1,240 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'graphql_api.graphql.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +OrderProducts$Query$ProductPaginator$PaginatorInfo + _$OrderProducts$Query$ProductPaginator$PaginatorInfoFromJson( + Map json) { + return OrderProducts$Query$ProductPaginator$PaginatorInfo() + ..count = json['count'] as int + ..currentPage = json['currentPage'] as int + ..firstItem = json['firstItem'] as int + ..lastItem = json['lastItem'] as int + ..hasMorePages = json['hasMorePages'] as bool + ..lastPage = json['lastPage'] as int + ..perPage = json['perPage'] as int + ..total = json['total'] as int; +} + +Map _$OrderProducts$Query$ProductPaginator$PaginatorInfoToJson( + OrderProducts$Query$ProductPaginator$PaginatorInfo instance) => + { + 'count': instance.count, + 'currentPage': instance.currentPage, + 'firstItem': instance.firstItem, + 'lastItem': instance.lastItem, + 'hasMorePages': instance.hasMorePages, + 'lastPage': instance.lastPage, + 'perPage': instance.perPage, + 'total': instance.total, + }; + +OrderProducts$Query$ProductPaginator$Product + _$OrderProducts$Query$ProductPaginator$ProductFromJson( + Map json) { + return OrderProducts$Query$ProductPaginator$Product() + ..id = json['id'] as String + ..averageRating = json['averageRating'] as String + ..price = json['price'] as String + ..available = json['available'] as bool + ..details = json['details'] == null + ? null + : ProductMixin$ProductData.fromJson( + json['details'] as Map); +} + +Map _$OrderProducts$Query$ProductPaginator$ProductToJson( + OrderProducts$Query$ProductPaginator$Product instance) => + { + 'id': instance.id, + 'averageRating': instance.averageRating, + 'price': instance.price, + 'available': instance.available, + 'details': instance.details?.toJson(), + }; + +OrderProducts$Query$ProductPaginator + _$OrderProducts$Query$ProductPaginatorFromJson(Map json) { + return OrderProducts$Query$ProductPaginator() + ..paginatorInfo = json['paginatorInfo'] == null + ? null + : OrderProducts$Query$ProductPaginator$PaginatorInfo.fromJson( + json['paginatorInfo'] as Map) + ..data = (json['data'] as List) + ?.map((e) => e == null + ? null + : OrderProducts$Query$ProductPaginator$Product.fromJson( + e as Map)) + ?.toList(); +} + +Map _$OrderProducts$Query$ProductPaginatorToJson( + OrderProducts$Query$ProductPaginator instance) => + { + 'paginatorInfo': instance.paginatorInfo?.toJson(), + 'data': instance.data?.map((e) => e?.toJson())?.toList(), + }; + +OrderProducts$Query _$OrderProducts$QueryFromJson(Map json) { + return OrderProducts$Query() + ..products = json['products'] == null + ? null + : OrderProducts$Query$ProductPaginator.fromJson( + json['products'] as Map); +} + +Map _$OrderProducts$QueryToJson( + OrderProducts$Query instance) => + { + 'products': instance.products?.toJson(), + }; + +ProductMixin$ProductData$Media _$ProductMixin$ProductData$MediaFromJson( + Map json) { + return ProductMixin$ProductData$Media()..url = json['url'] as String; +} + +Map _$ProductMixin$ProductData$MediaToJson( + ProductMixin$ProductData$Media instance) => + { + 'url': instance.url, + }; + +ProductMixin$ProductData$Unit _$ProductMixin$ProductData$UnitFromJson( + Map json) { + return ProductMixin$ProductData$Unit() + ..id = json['id'] as String + ..name = json['name'] as String; +} + +Map _$ProductMixin$ProductData$UnitToJson( + ProductMixin$ProductData$Unit instance) => + { + 'id': instance.id, + 'name': instance.name, + }; + +ProductMixin$ProductData$Category _$ProductMixin$ProductData$CategoryFromJson( + Map json) { + return ProductMixin$ProductData$Category()..id = json['id'] as String; +} + +Map _$ProductMixin$ProductData$CategoryToJson( + ProductMixin$ProductData$Category instance) => + { + 'id': instance.id, + }; + +ProductMixin$ProductData _$ProductMixin$ProductDataFromJson( + Map json) { + return ProductMixin$ProductData() + ..name = json['name'] as String + ..sku = json['sku'] as String + ..description = json['description'] as String + ..cover = json['cover'] == null + ? null + : ProductMixin$ProductData$Media.fromJson( + json['cover'] as Map) + ..unit = json['unit'] == null + ? null + : ProductMixin$ProductData$Unit.fromJson( + json['unit'] as Map) + ..media = (json['media'] as List) + ?.map((e) => e == null + ? null + : ProductMixin$ProductData$Media.fromJson( + e as Map)) + ?.toList() + ..category = json['category'] == null + ? null + : ProductMixin$ProductData$Category.fromJson( + json['category'] as Map); +} + +Map _$ProductMixin$ProductDataToJson( + ProductMixin$ProductData instance) => + { + 'name': instance.name, + 'sku': instance.sku, + 'description': instance.description, + 'cover': instance.cover?.toJson(), + 'unit': instance.unit?.toJson(), + 'media': instance.media?.map((e) => e?.toJson())?.toList(), + 'category': instance.category?.toJson(), + }; + +OrderProductsArguments _$OrderProductsArgumentsFromJson( + Map json) { + return OrderProductsArguments( + first: json['first'] as int, + page: json['page'] as int, + productsId: json['productsId'] as String, + catId: (json['catId'] as List)?.map((e) => e as String)?.toList(), + name: json['name'] as String, + fieldOfOrder: _$enumDecodeNullable( + _$ProductsOrderByColumnEnumMap, json['fieldOfOrder'], + unknownValue: ProductsOrderByColumn.artemisUnknown), + orderType: _$enumDecodeNullable(_$SortOrderEnumMap, json['orderType'], + unknownValue: SortOrder.artemisUnknown), + ); +} + +Map _$OrderProductsArgumentsToJson( + OrderProductsArguments instance) => + { + 'first': instance.first, + 'page': instance.page, + 'productsId': instance.productsId, + 'catId': instance.catId, + 'name': instance.name, + 'fieldOfOrder': _$ProductsOrderByColumnEnumMap[instance.fieldOfOrder], + 'orderType': _$SortOrderEnumMap[instance.orderType], + }; + +T _$enumDecode( + Map enumValues, + dynamic source, { + T unknownValue, +}) { + if (source == null) { + throw ArgumentError('A value must be provided. Supported values: ' + '${enumValues.values.join(', ')}'); + } + + final value = enumValues.entries + .singleWhere((e) => e.value == source, orElse: () => null) + ?.key; + + if (value == null && unknownValue == null) { + throw ArgumentError('`$source` is not one of the supported values: ' + '${enumValues.values.join(', ')}'); + } + return value ?? unknownValue; +} + +T _$enumDecodeNullable( + Map enumValues, + dynamic source, { + T unknownValue, +}) { + if (source == null) { + return null; + } + return _$enumDecode(enumValues, source, unknownValue: unknownValue); +} + +const _$ProductsOrderByColumnEnumMap = { + ProductsOrderByColumn.id: 'ID', + ProductsOrderByColumn.name: 'NAME', + ProductsOrderByColumn.artemisUnknown: 'ARTEMIS_UNKNOWN', +}; + +const _$SortOrderEnumMap = { + SortOrder.asc: 'ASC', + SortOrder.desc: 'DESC', + SortOrder.artemisUnknown: 'ARTEMIS_UNKNOWN', +}; diff --git a/lib/generatedql/orders/graphql_api.dart b/lib/generatedql/orders/graphql_api.dart index 682b9d8..196c5cd 100644 --- a/lib/generatedql/orders/graphql_api.dart +++ b/lib/generatedql/orders/graphql_api.dart @@ -1,244 +1,2 @@ // GENERATED CODE - DO NOT MODIFY BY HAND - -import 'package:artemis/artemis.dart'; -import 'package:json_annotation/json_annotation.dart'; -import 'package:equatable/equatable.dart'; -import 'package:gql/ast.dart'; -part 'graphql_api.g.dart'; - -mixin PagingMixin { - int count; - int currentPage; - int firstItem; - int lastItem; - bool hasMorePages; - int lastPage; - int perPage; - int total; -} - -@JsonSerializable(explicitToJson: true) -class Orders with EquatableMixin { - Orders(); - - factory Orders.fromJson(Map json) => _$OrdersFromJson(json); - - OrderPaginator orders; - - @override - List get props => [orders]; - Map toJson() => _$OrdersToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class OrderPaginator with EquatableMixin { - OrderPaginator(); - - factory OrderPaginator.fromJson(Map json) => - _$OrderPaginatorFromJson(json); - - PaginatorInfo paginatorInfo; - - List data; - - @override - List get props => [paginatorInfo, data]; - Map toJson() => _$OrderPaginatorToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class PaginatorInfo with EquatableMixin, PagingMixin { - PaginatorInfo(); - - factory PaginatorInfo.fromJson(Map json) => - _$PaginatorInfoFromJson(json); - - @override - List get props => [ - count, - currentPage, - firstItem, - lastItem, - hasMorePages, - lastPage, - perPage, - total - ]; - Map toJson() => _$PaginatorInfoToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Order with EquatableMixin { - Order(); - - factory Order.fromJson(Map json) => _$OrderFromJson(json); - - String id; - - String total; - - String payment_type; - - @override - List get props => [id, total, payment_type]; - Map toJson() => _$OrderToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class OrdersArguments extends JsonSerializable with EquatableMixin { - OrdersArguments({this.first, this.page}); - - factory OrdersArguments.fromJson(Map json) => - _$OrdersArgumentsFromJson(json); - - final int first; - - final int page; - - @override - List get props => [first, page]; - Map toJson() => _$OrdersArgumentsToJson(this); -} - -class OrdersQuery extends GraphQLQuery { - OrdersQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'Orders'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'first')), - type: - NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'page')), - type: - NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'orders'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'first'), - value: VariableNode(name: NameNode(value: 'first'))), - ArgumentNode( - name: NameNode(value: 'page'), - value: VariableNode(name: NameNode(value: 'page'))) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'paginatorInfo'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FragmentSpreadNode( - name: NameNode(value: 'Paging'), directives: []) - ])), - FieldNode( - name: NameNode(value: 'data'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'total'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'payment_type'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ])), - FragmentDefinitionNode( - name: NameNode(value: 'Paging'), - typeCondition: TypeConditionNode( - on: NamedTypeNode( - name: NameNode(value: 'PaginatorInfo'), isNonNull: false)), - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'count'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'currentPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'firstItem'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'lastItem'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'hasMorePages'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'lastPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'perPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'total'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ]); - - @override - final String operationName = 'Orders'; - - @override - final OrdersArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - Orders parse(Map json) => Orders.fromJson(json); -} +export 'graphql_api.graphql.dart'; diff --git a/lib/generatedql/orders/graphql_api.graphql.dart b/lib/generatedql/orders/graphql_api.graphql.dart new file mode 100644 index 0000000..ee7f6a1 --- /dev/null +++ b/lib/generatedql/orders/graphql_api.graphql.dart @@ -0,0 +1,255 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +import 'package:meta/meta.dart'; +import 'package:artemis/artemis.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:equatable/equatable.dart'; +import 'package:gql/ast.dart'; +part 'graphql_api.graphql.g.dart'; + +mixin PagingMixin { + int count; + int currentPage; + int firstItem; + int lastItem; + bool hasMorePages; + int lastPage; + int perPage; + int total; +} + +@JsonSerializable(explicitToJson: true) +class Orders$Query$OrderPaginator$PaginatorInfo + with EquatableMixin, PagingMixin { + Orders$Query$OrderPaginator$PaginatorInfo(); + + factory Orders$Query$OrderPaginator$PaginatorInfo.fromJson( + Map json) => + _$Orders$Query$OrderPaginator$PaginatorInfoFromJson(json); + + @override + List get props => [ + count, + currentPage, + firstItem, + lastItem, + hasMorePages, + lastPage, + perPage, + total + ]; + Map toJson() => + _$Orders$Query$OrderPaginator$PaginatorInfoToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Orders$Query$OrderPaginator$Order with EquatableMixin { + Orders$Query$OrderPaginator$Order(); + + factory Orders$Query$OrderPaginator$Order.fromJson( + Map json) => + _$Orders$Query$OrderPaginator$OrderFromJson(json); + + String id; + + String total; + + @JsonKey(name: 'payment_type') + String paymentType; + + @override + List get props => [id, total, paymentType]; + Map toJson() => + _$Orders$Query$OrderPaginator$OrderToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Orders$Query$OrderPaginator with EquatableMixin { + Orders$Query$OrderPaginator(); + + factory Orders$Query$OrderPaginator.fromJson(Map json) => + _$Orders$Query$OrderPaginatorFromJson(json); + + Orders$Query$OrderPaginator$PaginatorInfo paginatorInfo; + + List data; + + @override + List get props => [paginatorInfo, data]; + Map toJson() => _$Orders$Query$OrderPaginatorToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Orders$Query with EquatableMixin { + Orders$Query(); + + factory Orders$Query.fromJson(Map json) => + _$Orders$QueryFromJson(json); + + Orders$Query$OrderPaginator orders; + + @override + List get props => [orders]; + Map toJson() => _$Orders$QueryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class OrdersArguments extends JsonSerializable with EquatableMixin { + OrdersArguments({@required this.first, @required this.page}); + + @override + factory OrdersArguments.fromJson(Map json) => + _$OrdersArgumentsFromJson(json); + + final int first; + + final int page; + + @override + List get props => [first, page]; + @override + Map toJson() => _$OrdersArgumentsToJson(this); +} + +class OrdersQuery extends GraphQLQuery { + OrdersQuery({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'Orders'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'first')), + type: + NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'page')), + type: + NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'orders'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'first'), + value: VariableNode(name: NameNode(value: 'first'))), + ArgumentNode( + name: NameNode(value: 'page'), + value: VariableNode(name: NameNode(value: 'page'))) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'paginatorInfo'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'Paging'), directives: []) + ])), + FieldNode( + name: NameNode(value: 'data'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'total'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'payment_type'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ])), + FragmentDefinitionNode( + name: NameNode(value: 'Paging'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'PaginatorInfo'), isNonNull: false)), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'count'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'currentPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'firstItem'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'lastItem'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'hasMorePages'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'lastPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'perPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'total'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ]); + + @override + final String operationName = 'Orders'; + + @override + final OrdersArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + Orders$Query parse(Map json) => Orders$Query.fromJson(json); +} diff --git a/lib/generatedql/orders/graphql_api.g.dart b/lib/generatedql/orders/graphql_api.graphql.g.dart similarity index 52% rename from lib/generatedql/orders/graphql_api.g.dart rename to lib/generatedql/orders/graphql_api.graphql.g.dart index a46aa87..c756671 100644 --- a/lib/generatedql/orders/graphql_api.g.dart +++ b/lib/generatedql/orders/graphql_api.graphql.g.dart @@ -1,41 +1,15 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'graphql_api.dart'; +part of 'graphql_api.graphql.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -Orders _$OrdersFromJson(Map json) { - return Orders() - ..orders = json['orders'] == null - ? null - : OrderPaginator.fromJson(json['orders'] as Map); -} - -Map _$OrdersToJson(Orders instance) => { - 'orders': instance.orders?.toJson(), - }; - -OrderPaginator _$OrderPaginatorFromJson(Map json) { - return OrderPaginator() - ..paginatorInfo = json['paginatorInfo'] == null - ? null - : PaginatorInfo.fromJson(json['paginatorInfo'] as Map) - ..data = (json['data'] as List) - ?.map( - (e) => e == null ? null : Order.fromJson(e as Map)) - ?.toList(); -} - -Map _$OrderPaginatorToJson(OrderPaginator instance) => - { - 'paginatorInfo': instance.paginatorInfo?.toJson(), - 'data': instance.data?.map((e) => e?.toJson())?.toList(), - }; - -PaginatorInfo _$PaginatorInfoFromJson(Map json) { - return PaginatorInfo() +Orders$Query$OrderPaginator$PaginatorInfo + _$Orders$Query$OrderPaginator$PaginatorInfoFromJson( + Map json) { + return Orders$Query$OrderPaginator$PaginatorInfo() ..count = json['count'] as int ..currentPage = json['currentPage'] as int ..firstItem = json['firstItem'] as int @@ -46,7 +20,8 @@ PaginatorInfo _$PaginatorInfoFromJson(Map json) { ..total = json['total'] as int; } -Map _$PaginatorInfoToJson(PaginatorInfo instance) => +Map _$Orders$Query$OrderPaginator$PaginatorInfoToJson( + Orders$Query$OrderPaginator$PaginatorInfo instance) => { 'count': instance.count, 'currentPage': instance.currentPage, @@ -58,17 +33,55 @@ Map _$PaginatorInfoToJson(PaginatorInfo instance) => 'total': instance.total, }; -Order _$OrderFromJson(Map json) { - return Order() +Orders$Query$OrderPaginator$Order _$Orders$Query$OrderPaginator$OrderFromJson( + Map json) { + return Orders$Query$OrderPaginator$Order() ..id = json['id'] as String ..total = json['total'] as String - ..payment_type = json['payment_type'] as String; + ..paymentType = json['payment_type'] as String; } -Map _$OrderToJson(Order instance) => { +Map _$Orders$Query$OrderPaginator$OrderToJson( + Orders$Query$OrderPaginator$Order instance) => + { 'id': instance.id, 'total': instance.total, - 'payment_type': instance.payment_type, + 'payment_type': instance.paymentType, + }; + +Orders$Query$OrderPaginator _$Orders$Query$OrderPaginatorFromJson( + Map json) { + return Orders$Query$OrderPaginator() + ..paginatorInfo = json['paginatorInfo'] == null + ? null + : Orders$Query$OrderPaginator$PaginatorInfo.fromJson( + json['paginatorInfo'] as Map) + ..data = (json['data'] as List) + ?.map((e) => e == null + ? null + : Orders$Query$OrderPaginator$Order.fromJson( + e as Map)) + ?.toList(); +} + +Map _$Orders$Query$OrderPaginatorToJson( + Orders$Query$OrderPaginator instance) => + { + 'paginatorInfo': instance.paginatorInfo?.toJson(), + 'data': instance.data?.map((e) => e?.toJson())?.toList(), + }; + +Orders$Query _$Orders$QueryFromJson(Map json) { + return Orders$Query() + ..orders = json['orders'] == null + ? null + : Orders$Query$OrderPaginator.fromJson( + json['orders'] as Map); +} + +Map _$Orders$QueryToJson(Orders$Query instance) => + { + 'orders': instance.orders?.toJson(), }; OrdersArguments _$OrdersArgumentsFromJson(Map json) { diff --git a/lib/generatedql/products/graphql_api.dart b/lib/generatedql/products/graphql_api.dart index e0f6219..196c5cd 100644 --- a/lib/generatedql/products/graphql_api.dart +++ b/lib/generatedql/products/graphql_api.dart @@ -1,456 +1,2 @@ // GENERATED CODE - DO NOT MODIFY BY HAND - -import 'package:artemis/artemis.dart'; -import 'package:json_annotation/json_annotation.dart'; -import 'package:equatable/equatable.dart'; -import 'package:gql/ast.dart'; -part 'graphql_api.g.dart'; - -mixin PagingMixin { - int count; - int currentPage; - int firstItem; - int lastItem; - bool hasMorePages; - int lastPage; - int perPage; - int total; -} -mixin ProductMixin { - String id; - String averageRating; - String price; - bool available; - ProductData details; -} - -@JsonSerializable(explicitToJson: true) -class Products with EquatableMixin { - Products(); - - factory Products.fromJson(Map json) => - _$ProductsFromJson(json); - - ProductPaginator products; - - @override - List get props => [products]; - Map toJson() => _$ProductsToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class ProductPaginator with EquatableMixin { - ProductPaginator(); - - factory ProductPaginator.fromJson(Map json) => - _$ProductPaginatorFromJson(json); - - PaginatorInfo paginatorInfo; - - List data; - - @override - List get props => [paginatorInfo, data]; - Map toJson() => _$ProductPaginatorToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class PaginatorInfo with EquatableMixin, PagingMixin { - PaginatorInfo(); - - factory PaginatorInfo.fromJson(Map json) => - _$PaginatorInfoFromJson(json); - - @override - List get props => [ - count, - currentPage, - firstItem, - lastItem, - hasMorePages, - lastPage, - perPage, - total - ]; - Map toJson() => _$PaginatorInfoToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Product with EquatableMixin, ProductMixin { - Product(); - - factory Product.fromJson(Map json) => - _$ProductFromJson(json); - - @override - List get props => [id, averageRating, price, available, details]; - Map toJson() => _$ProductToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class ProductData with EquatableMixin { - ProductData(); - - factory ProductData.fromJson(Map json) => - _$ProductDataFromJson(json); - - String name; - - String sku; - - String description; - - Media cover; - - Unit unit; - - List media; - - Category category; - - @override - List get props => - [name, sku, description, cover, unit, media, category]; - Map toJson() => _$ProductDataToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Media with EquatableMixin { - Media(); - - factory Media.fromJson(Map json) => _$MediaFromJson(json); - - String url; - - @override - List get props => [url]; - Map toJson() => _$MediaToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Unit with EquatableMixin { - Unit(); - - factory Unit.fromJson(Map json) => _$UnitFromJson(json); - - String id; - - String name; - - @override - List get props => [id, name]; - Map toJson() => _$UnitToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Category with EquatableMixin { - Category(); - - factory Category.fromJson(Map json) => - _$CategoryFromJson(json); - - String id; - - @override - List get props => [id]; - Map toJson() => _$CategoryToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class ProductsArguments extends JsonSerializable with EquatableMixin { - ProductsArguments( - {this.first, this.page, this.productsId, this.catId, this.name}); - - factory ProductsArguments.fromJson(Map json) => - _$ProductsArgumentsFromJson(json); - - final int first; - - final int page; - - final String productsId; - - final List catId; - - final String name; - - @override - List get props => [first, page, productsId, catId, name]; - Map toJson() => _$ProductsArgumentsToJson(this); -} - -class ProductsQuery extends GraphQLQuery { - ProductsQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'Products'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'first')), - type: - NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'page')), - type: - NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'productsId')), - type: - NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: false), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'catId')), - type: ListTypeNode( - type: NamedTypeNode( - name: NameNode(value: 'ID'), isNonNull: false), - isNonNull: false), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'name')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: false), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'products'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'first'), - value: VariableNode(name: NameNode(value: 'first'))), - ArgumentNode( - name: NameNode(value: 'page'), - value: VariableNode(name: NameNode(value: 'page'))), - ArgumentNode( - name: NameNode(value: 'filter'), - value: ObjectValueNode(fields: [ - ObjectFieldNode( - name: NameNode(value: 'name'), - value: VariableNode(name: NameNode(value: 'name'))), - ObjectFieldNode( - name: NameNode(value: 'id'), - value: VariableNode( - name: NameNode(value: 'productsId'))), - ObjectFieldNode( - name: NameNode(value: 'category'), - value: VariableNode(name: NameNode(value: 'catId'))) - ])) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'paginatorInfo'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FragmentSpreadNode( - name: NameNode(value: 'Paging'), directives: []) - ])), - FieldNode( - name: NameNode(value: 'data'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FragmentSpreadNode( - name: NameNode(value: 'Product'), directives: []) - ])) - ])) - ])), - FragmentDefinitionNode( - name: NameNode(value: 'Paging'), - typeCondition: TypeConditionNode( - on: NamedTypeNode( - name: NameNode(value: 'PaginatorInfo'), isNonNull: false)), - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'count'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'currentPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'firstItem'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'lastItem'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'hasMorePages'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'lastPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'perPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'total'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FragmentDefinitionNode( - name: NameNode(value: 'Product'), - typeCondition: TypeConditionNode( - on: NamedTypeNode( - name: NameNode(value: 'Product'), isNonNull: false)), - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'averageRating'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'price'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'available'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'details'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'sku'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'description'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'cover'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'url'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'unit'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'media'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'url'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'category'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ])) - ]); - - @override - final String operationName = 'Products'; - - @override - final ProductsArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - Products parse(Map json) => Products.fromJson(json); -} +export 'graphql_api.graphql.dart'; diff --git a/lib/generatedql/products/graphql_api.g.dart b/lib/generatedql/products/graphql_api.g.dart deleted file mode 100644 index c0b2069..0000000 --- a/lib/generatedql/products/graphql_api.g.dart +++ /dev/null @@ -1,155 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'graphql_api.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -Products _$ProductsFromJson(Map json) { - return Products() - ..products = json['products'] == null - ? null - : ProductPaginator.fromJson(json['products'] as Map); -} - -Map _$ProductsToJson(Products instance) => { - 'products': instance.products?.toJson(), - }; - -ProductPaginator _$ProductPaginatorFromJson(Map json) { - return ProductPaginator() - ..paginatorInfo = json['paginatorInfo'] == null - ? null - : PaginatorInfo.fromJson(json['paginatorInfo'] as Map) - ..data = (json['data'] as List) - ?.map((e) => - e == null ? null : Product.fromJson(e as Map)) - ?.toList(); -} - -Map _$ProductPaginatorToJson(ProductPaginator instance) => - { - 'paginatorInfo': instance.paginatorInfo?.toJson(), - 'data': instance.data?.map((e) => e?.toJson())?.toList(), - }; - -PaginatorInfo _$PaginatorInfoFromJson(Map json) { - return PaginatorInfo() - ..count = json['count'] as int - ..currentPage = json['currentPage'] as int - ..firstItem = json['firstItem'] as int - ..lastItem = json['lastItem'] as int - ..hasMorePages = json['hasMorePages'] as bool - ..lastPage = json['lastPage'] as int - ..perPage = json['perPage'] as int - ..total = json['total'] as int; -} - -Map _$PaginatorInfoToJson(PaginatorInfo instance) => - { - 'count': instance.count, - 'currentPage': instance.currentPage, - 'firstItem': instance.firstItem, - 'lastItem': instance.lastItem, - 'hasMorePages': instance.hasMorePages, - 'lastPage': instance.lastPage, - 'perPage': instance.perPage, - 'total': instance.total, - }; - -Product _$ProductFromJson(Map json) { - return Product() - ..id = json['id'] as String - ..averageRating = json['averageRating'] as String - ..price = json['price'] as String - ..available = json['available'] as bool - ..details = json['details'] == null - ? null - : ProductData.fromJson(json['details'] as Map); -} - -Map _$ProductToJson(Product instance) => { - 'id': instance.id, - 'averageRating': instance.averageRating, - 'price': instance.price, - 'available': instance.available, - 'details': instance.details?.toJson(), - }; - -ProductData _$ProductDataFromJson(Map json) { - return ProductData() - ..name = json['name'] as String - ..sku = json['sku'] as String - ..description = json['description'] as String - ..cover = json['cover'] == null - ? null - : Media.fromJson(json['cover'] as Map) - ..unit = json['unit'] == null - ? null - : Unit.fromJson(json['unit'] as Map) - ..media = (json['media'] as List) - ?.map( - (e) => e == null ? null : Media.fromJson(e as Map)) - ?.toList() - ..category = json['category'] == null - ? null - : Category.fromJson(json['category'] as Map); -} - -Map _$ProductDataToJson(ProductData instance) => - { - 'name': instance.name, - 'sku': instance.sku, - 'description': instance.description, - 'cover': instance.cover?.toJson(), - 'unit': instance.unit?.toJson(), - 'media': instance.media?.map((e) => e?.toJson())?.toList(), - 'category': instance.category?.toJson(), - }; - -Media _$MediaFromJson(Map json) { - return Media()..url = json['url'] as String; -} - -Map _$MediaToJson(Media instance) => { - 'url': instance.url, - }; - -Unit _$UnitFromJson(Map json) { - return Unit() - ..id = json['id'] as String - ..name = json['name'] as String; -} - -Map _$UnitToJson(Unit instance) => { - 'id': instance.id, - 'name': instance.name, - }; - -Category _$CategoryFromJson(Map json) { - return Category()..id = json['id'] as String; -} - -Map _$CategoryToJson(Category instance) => { - 'id': instance.id, - }; - -ProductsArguments _$ProductsArgumentsFromJson(Map json) { - return ProductsArguments( - first: json['first'] as int, - page: json['page'] as int, - productsId: json['productsId'] as String, - catId: (json['catId'] as List)?.map((e) => e as String)?.toList(), - name: json['name'] as String, - ); -} - -Map _$ProductsArgumentsToJson(ProductsArguments instance) => - { - 'first': instance.first, - 'page': instance.page, - 'productsId': instance.productsId, - 'catId': instance.catId, - 'name': instance.name, - }; diff --git a/lib/generatedql/products/graphql_api.graphql.dart b/lib/generatedql/products/graphql_api.graphql.dart new file mode 100644 index 0000000..fb676d4 --- /dev/null +++ b/lib/generatedql/products/graphql_api.graphql.dart @@ -0,0 +1,475 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +import 'package:meta/meta.dart'; +import 'package:artemis/artemis.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:equatable/equatable.dart'; +import 'package:gql/ast.dart'; +part 'graphql_api.graphql.g.dart'; + +mixin PagingMixin { + int count; + int currentPage; + int firstItem; + int lastItem; + bool hasMorePages; + int lastPage; + int perPage; + int total; +} +mixin ProductMixin { + String id; + String averageRating; + String price; + bool available; + ProductMixin$ProductData details; +} + +@JsonSerializable(explicitToJson: true) +class Products$Query$ProductPaginator$PaginatorInfo + with EquatableMixin, PagingMixin { + Products$Query$ProductPaginator$PaginatorInfo(); + + factory Products$Query$ProductPaginator$PaginatorInfo.fromJson( + Map json) => + _$Products$Query$ProductPaginator$PaginatorInfoFromJson(json); + + @override + List get props => [ + count, + currentPage, + firstItem, + lastItem, + hasMorePages, + lastPage, + perPage, + total + ]; + Map toJson() => + _$Products$Query$ProductPaginator$PaginatorInfoToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Products$Query$ProductPaginator$Product + with EquatableMixin, ProductMixin { + Products$Query$ProductPaginator$Product(); + + factory Products$Query$ProductPaginator$Product.fromJson( + Map json) => + _$Products$Query$ProductPaginator$ProductFromJson(json); + + @override + List get props => [id, averageRating, price, available, details]; + Map toJson() => + _$Products$Query$ProductPaginator$ProductToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Products$Query$ProductPaginator with EquatableMixin { + Products$Query$ProductPaginator(); + + factory Products$Query$ProductPaginator.fromJson(Map json) => + _$Products$Query$ProductPaginatorFromJson(json); + + Products$Query$ProductPaginator$PaginatorInfo paginatorInfo; + + List data; + + @override + List get props => [paginatorInfo, data]; + Map toJson() => + _$Products$Query$ProductPaginatorToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Products$Query with EquatableMixin { + Products$Query(); + + factory Products$Query.fromJson(Map json) => + _$Products$QueryFromJson(json); + + Products$Query$ProductPaginator products; + + @override + List get props => [products]; + Map toJson() => _$Products$QueryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ProductMixin$ProductData$Media with EquatableMixin { + ProductMixin$ProductData$Media(); + + factory ProductMixin$ProductData$Media.fromJson(Map json) => + _$ProductMixin$ProductData$MediaFromJson(json); + + String url; + + @override + List get props => [url]; + Map toJson() => _$ProductMixin$ProductData$MediaToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ProductMixin$ProductData$Unit with EquatableMixin { + ProductMixin$ProductData$Unit(); + + factory ProductMixin$ProductData$Unit.fromJson(Map json) => + _$ProductMixin$ProductData$UnitFromJson(json); + + String id; + + String name; + + @override + List get props => [id, name]; + Map toJson() => _$ProductMixin$ProductData$UnitToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ProductMixin$ProductData$Category with EquatableMixin { + ProductMixin$ProductData$Category(); + + factory ProductMixin$ProductData$Category.fromJson( + Map json) => + _$ProductMixin$ProductData$CategoryFromJson(json); + + String id; + + @override + List get props => [id]; + Map toJson() => + _$ProductMixin$ProductData$CategoryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ProductMixin$ProductData with EquatableMixin { + ProductMixin$ProductData(); + + factory ProductMixin$ProductData.fromJson(Map json) => + _$ProductMixin$ProductDataFromJson(json); + + String name; + + String sku; + + String description; + + ProductMixin$ProductData$Media cover; + + ProductMixin$ProductData$Unit unit; + + List media; + + ProductMixin$ProductData$Category category; + + @override + List get props => + [name, sku, description, cover, unit, media, category]; + Map toJson() => _$ProductMixin$ProductDataToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ProductsArguments extends JsonSerializable with EquatableMixin { + ProductsArguments( + {@required this.first, + @required this.page, + this.productsId, + this.catId, + this.name}); + + @override + factory ProductsArguments.fromJson(Map json) => + _$ProductsArgumentsFromJson(json); + + final int first; + + final int page; + + final String productsId; + + final List catId; + + final String name; + + @override + List get props => [first, page, productsId, catId, name]; + @override + Map toJson() => _$ProductsArgumentsToJson(this); +} + +class ProductsQuery extends GraphQLQuery { + ProductsQuery({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'Products'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'first')), + type: + NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'page')), + type: + NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'productsId')), + type: + NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: false), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'catId')), + type: ListTypeNode( + type: NamedTypeNode( + name: NameNode(value: 'ID'), isNonNull: false), + isNonNull: false), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'name')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: false), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'products'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'first'), + value: VariableNode(name: NameNode(value: 'first'))), + ArgumentNode( + name: NameNode(value: 'page'), + value: VariableNode(name: NameNode(value: 'page'))), + ArgumentNode( + name: NameNode(value: 'filter'), + value: ObjectValueNode(fields: [ + ObjectFieldNode( + name: NameNode(value: 'name'), + value: VariableNode(name: NameNode(value: 'name'))), + ObjectFieldNode( + name: NameNode(value: 'id'), + value: VariableNode( + name: NameNode(value: 'productsId'))), + ObjectFieldNode( + name: NameNode(value: 'category'), + value: VariableNode(name: NameNode(value: 'catId'))) + ])) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'paginatorInfo'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'Paging'), directives: []) + ])), + FieldNode( + name: NameNode(value: 'data'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'Product'), directives: []) + ])) + ])) + ])), + FragmentDefinitionNode( + name: NameNode(value: 'Paging'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'PaginatorInfo'), isNonNull: false)), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'count'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'currentPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'firstItem'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'lastItem'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'hasMorePages'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'lastPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'perPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'total'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FragmentDefinitionNode( + name: NameNode(value: 'Product'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'Product'), isNonNull: false)), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'averageRating'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'price'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'available'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'details'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'sku'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'description'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'cover'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'url'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'unit'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'media'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'url'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'category'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ])) + ]); + + @override + final String operationName = 'Products'; + + @override + final ProductsArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + Products$Query parse(Map json) => + Products$Query.fromJson(json); +} diff --git a/lib/generatedql/products/graphql_api.graphql.g.dart b/lib/generatedql/products/graphql_api.graphql.g.dart new file mode 100644 index 0000000..2c96532 --- /dev/null +++ b/lib/generatedql/products/graphql_api.graphql.g.dart @@ -0,0 +1,186 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'graphql_api.graphql.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Products$Query$ProductPaginator$PaginatorInfo + _$Products$Query$ProductPaginator$PaginatorInfoFromJson( + Map json) { + return Products$Query$ProductPaginator$PaginatorInfo() + ..count = json['count'] as int + ..currentPage = json['currentPage'] as int + ..firstItem = json['firstItem'] as int + ..lastItem = json['lastItem'] as int + ..hasMorePages = json['hasMorePages'] as bool + ..lastPage = json['lastPage'] as int + ..perPage = json['perPage'] as int + ..total = json['total'] as int; +} + +Map _$Products$Query$ProductPaginator$PaginatorInfoToJson( + Products$Query$ProductPaginator$PaginatorInfo instance) => + { + 'count': instance.count, + 'currentPage': instance.currentPage, + 'firstItem': instance.firstItem, + 'lastItem': instance.lastItem, + 'hasMorePages': instance.hasMorePages, + 'lastPage': instance.lastPage, + 'perPage': instance.perPage, + 'total': instance.total, + }; + +Products$Query$ProductPaginator$Product + _$Products$Query$ProductPaginator$ProductFromJson( + Map json) { + return Products$Query$ProductPaginator$Product() + ..id = json['id'] as String + ..averageRating = json['averageRating'] as String + ..price = json['price'] as String + ..available = json['available'] as bool + ..details = json['details'] == null + ? null + : ProductMixin$ProductData.fromJson( + json['details'] as Map); +} + +Map _$Products$Query$ProductPaginator$ProductToJson( + Products$Query$ProductPaginator$Product instance) => + { + 'id': instance.id, + 'averageRating': instance.averageRating, + 'price': instance.price, + 'available': instance.available, + 'details': instance.details?.toJson(), + }; + +Products$Query$ProductPaginator _$Products$Query$ProductPaginatorFromJson( + Map json) { + return Products$Query$ProductPaginator() + ..paginatorInfo = json['paginatorInfo'] == null + ? null + : Products$Query$ProductPaginator$PaginatorInfo.fromJson( + json['paginatorInfo'] as Map) + ..data = (json['data'] as List) + ?.map((e) => e == null + ? null + : Products$Query$ProductPaginator$Product.fromJson( + e as Map)) + ?.toList(); +} + +Map _$Products$Query$ProductPaginatorToJson( + Products$Query$ProductPaginator instance) => + { + 'paginatorInfo': instance.paginatorInfo?.toJson(), + 'data': instance.data?.map((e) => e?.toJson())?.toList(), + }; + +Products$Query _$Products$QueryFromJson(Map json) { + return Products$Query() + ..products = json['products'] == null + ? null + : Products$Query$ProductPaginator.fromJson( + json['products'] as Map); +} + +Map _$Products$QueryToJson(Products$Query instance) => + { + 'products': instance.products?.toJson(), + }; + +ProductMixin$ProductData$Media _$ProductMixin$ProductData$MediaFromJson( + Map json) { + return ProductMixin$ProductData$Media()..url = json['url'] as String; +} + +Map _$ProductMixin$ProductData$MediaToJson( + ProductMixin$ProductData$Media instance) => + { + 'url': instance.url, + }; + +ProductMixin$ProductData$Unit _$ProductMixin$ProductData$UnitFromJson( + Map json) { + return ProductMixin$ProductData$Unit() + ..id = json['id'] as String + ..name = json['name'] as String; +} + +Map _$ProductMixin$ProductData$UnitToJson( + ProductMixin$ProductData$Unit instance) => + { + 'id': instance.id, + 'name': instance.name, + }; + +ProductMixin$ProductData$Category _$ProductMixin$ProductData$CategoryFromJson( + Map json) { + return ProductMixin$ProductData$Category()..id = json['id'] as String; +} + +Map _$ProductMixin$ProductData$CategoryToJson( + ProductMixin$ProductData$Category instance) => + { + 'id': instance.id, + }; + +ProductMixin$ProductData _$ProductMixin$ProductDataFromJson( + Map json) { + return ProductMixin$ProductData() + ..name = json['name'] as String + ..sku = json['sku'] as String + ..description = json['description'] as String + ..cover = json['cover'] == null + ? null + : ProductMixin$ProductData$Media.fromJson( + json['cover'] as Map) + ..unit = json['unit'] == null + ? null + : ProductMixin$ProductData$Unit.fromJson( + json['unit'] as Map) + ..media = (json['media'] as List) + ?.map((e) => e == null + ? null + : ProductMixin$ProductData$Media.fromJson( + e as Map)) + ?.toList() + ..category = json['category'] == null + ? null + : ProductMixin$ProductData$Category.fromJson( + json['category'] as Map); +} + +Map _$ProductMixin$ProductDataToJson( + ProductMixin$ProductData instance) => + { + 'name': instance.name, + 'sku': instance.sku, + 'description': instance.description, + 'cover': instance.cover?.toJson(), + 'unit': instance.unit?.toJson(), + 'media': instance.media?.map((e) => e?.toJson())?.toList(), + 'category': instance.category?.toJson(), + }; + +ProductsArguments _$ProductsArgumentsFromJson(Map json) { + return ProductsArguments( + first: json['first'] as int, + page: json['page'] as int, + productsId: json['productsId'] as String, + catId: (json['catId'] as List)?.map((e) => e as String)?.toList(), + name: json['name'] as String, + ); +} + +Map _$ProductsArgumentsToJson(ProductsArguments instance) => + { + 'first': instance.first, + 'page': instance.page, + 'productsId': instance.productsId, + 'catId': instance.catId, + 'name': instance.name, + }; diff --git a/lib/generatedql/ratings/graphql_api.dart b/lib/generatedql/ratings/graphql_api.dart index 8ae3fcc..196c5cd 100644 --- a/lib/generatedql/ratings/graphql_api.dart +++ b/lib/generatedql/ratings/graphql_api.dart @@ -1,299 +1,2 @@ // GENERATED CODE - DO NOT MODIFY BY HAND - -import 'package:artemis/artemis.dart'; -import 'package:json_annotation/json_annotation.dart'; -import 'package:equatable/equatable.dart'; -import 'package:gql/ast.dart'; -part 'graphql_api.g.dart'; - -mixin PagingMixin { - int count; - int currentPage; - int firstItem; - int lastItem; - bool hasMorePages; - int lastPage; - int perPage; - int total; -} - -@JsonSerializable(explicitToJson: true) -class Ratings with EquatableMixin { - Ratings(); - - factory Ratings.fromJson(Map json) => - _$RatingsFromJson(json); - - RatingPaginator ratings; - - @override - List get props => [ratings]; - Map toJson() => _$RatingsToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class RatingPaginator with EquatableMixin { - RatingPaginator(); - - factory RatingPaginator.fromJson(Map json) => - _$RatingPaginatorFromJson(json); - - PaginatorInfo paginatorInfo; - - List data; - - @override - List get props => [paginatorInfo, data]; - Map toJson() => _$RatingPaginatorToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class PaginatorInfo with EquatableMixin, PagingMixin { - PaginatorInfo(); - - factory PaginatorInfo.fromJson(Map json) => - _$PaginatorInfoFromJson(json); - - @override - List get props => [ - count, - currentPage, - firstItem, - lastItem, - hasMorePages, - lastPage, - perPage, - total - ]; - Map toJson() => _$PaginatorInfoToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Rating with EquatableMixin { - Rating(); - - factory Rating.fromJson(Map json) => _$RatingFromJson(json); - - int rating; - - String review; - - User user; - - @override - List get props => [rating, review, user]; - Map toJson() => _$RatingToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class User with EquatableMixin { - User(); - - factory User.fromJson(Map json) => _$UserFromJson(json); - - String id; - - String name; - - String email; - - String mobile; - - @override - List get props => [id, name, email, mobile]; - Map toJson() => _$UserToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class RatingsArguments extends JsonSerializable with EquatableMixin { - RatingsArguments({this.first, this.page, this.productsId}); - - factory RatingsArguments.fromJson(Map json) => - _$RatingsArgumentsFromJson(json); - - final int first; - - final int page; - - final String productsId; - - @override - List get props => [first, page, productsId]; - Map toJson() => _$RatingsArgumentsToJson(this); -} - -class RatingsQuery extends GraphQLQuery { - RatingsQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'Ratings'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'first')), - type: - NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'page')), - type: - NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'productsId')), - type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'ratings'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'first'), - value: VariableNode(name: NameNode(value: 'first'))), - ArgumentNode( - name: NameNode(value: 'page'), - value: VariableNode(name: NameNode(value: 'page'))), - ArgumentNode( - name: NameNode(value: 'product_id'), - value: VariableNode(name: NameNode(value: 'productsId'))) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'paginatorInfo'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FragmentSpreadNode( - name: NameNode(value: 'Paging'), directives: []) - ])), - FieldNode( - name: NameNode(value: 'data'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'rating'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'review'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'user'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'email'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'mobile'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ])) - ])), - FragmentDefinitionNode( - name: NameNode(value: 'Paging'), - typeCondition: TypeConditionNode( - on: NamedTypeNode( - name: NameNode(value: 'PaginatorInfo'), isNonNull: false)), - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'count'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'currentPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'firstItem'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'lastItem'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'hasMorePages'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'lastPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'perPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'total'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ]); - - @override - final String operationName = 'Ratings'; - - @override - final RatingsArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - Ratings parse(Map json) => Ratings.fromJson(json); -} +export 'graphql_api.graphql.dart'; diff --git a/lib/generatedql/ratings/graphql_api.graphql.dart b/lib/generatedql/ratings/graphql_api.graphql.dart new file mode 100644 index 0000000..a5cb713 --- /dev/null +++ b/lib/generatedql/ratings/graphql_api.graphql.dart @@ -0,0 +1,313 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +import 'package:meta/meta.dart'; +import 'package:artemis/artemis.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:equatable/equatable.dart'; +import 'package:gql/ast.dart'; +part 'graphql_api.graphql.g.dart'; + +mixin PagingMixin { + int count; + int currentPage; + int firstItem; + int lastItem; + bool hasMorePages; + int lastPage; + int perPage; + int total; +} + +@JsonSerializable(explicitToJson: true) +class Ratings$Query$RatingPaginator$PaginatorInfo + with EquatableMixin, PagingMixin { + Ratings$Query$RatingPaginator$PaginatorInfo(); + + factory Ratings$Query$RatingPaginator$PaginatorInfo.fromJson( + Map json) => + _$Ratings$Query$RatingPaginator$PaginatorInfoFromJson(json); + + @override + List get props => [ + count, + currentPage, + firstItem, + lastItem, + hasMorePages, + lastPage, + perPage, + total + ]; + Map toJson() => + _$Ratings$Query$RatingPaginator$PaginatorInfoToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Ratings$Query$RatingPaginator$Rating$User with EquatableMixin { + Ratings$Query$RatingPaginator$Rating$User(); + + factory Ratings$Query$RatingPaginator$Rating$User.fromJson( + Map json) => + _$Ratings$Query$RatingPaginator$Rating$UserFromJson(json); + + String id; + + String name; + + String email; + + String mobile; + + @override + List get props => [id, name, email, mobile]; + Map toJson() => + _$Ratings$Query$RatingPaginator$Rating$UserToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Ratings$Query$RatingPaginator$Rating with EquatableMixin { + Ratings$Query$RatingPaginator$Rating(); + + factory Ratings$Query$RatingPaginator$Rating.fromJson( + Map json) => + _$Ratings$Query$RatingPaginator$RatingFromJson(json); + + int rating; + + String review; + + Ratings$Query$RatingPaginator$Rating$User user; + + @override + List get props => [rating, review, user]; + Map toJson() => + _$Ratings$Query$RatingPaginator$RatingToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Ratings$Query$RatingPaginator with EquatableMixin { + Ratings$Query$RatingPaginator(); + + factory Ratings$Query$RatingPaginator.fromJson(Map json) => + _$Ratings$Query$RatingPaginatorFromJson(json); + + Ratings$Query$RatingPaginator$PaginatorInfo paginatorInfo; + + List data; + + @override + List get props => [paginatorInfo, data]; + Map toJson() => _$Ratings$Query$RatingPaginatorToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Ratings$Query with EquatableMixin { + Ratings$Query(); + + factory Ratings$Query.fromJson(Map json) => + _$Ratings$QueryFromJson(json); + + Ratings$Query$RatingPaginator ratings; + + @override + List get props => [ratings]; + Map toJson() => _$Ratings$QueryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class RatingsArguments extends JsonSerializable with EquatableMixin { + RatingsArguments( + {@required this.first, @required this.page, @required this.productsId}); + + @override + factory RatingsArguments.fromJson(Map json) => + _$RatingsArgumentsFromJson(json); + + final int first; + + final int page; + + final String productsId; + + @override + List get props => [first, page, productsId]; + @override + Map toJson() => _$RatingsArgumentsToJson(this); +} + +class RatingsQuery extends GraphQLQuery { + RatingsQuery({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'Ratings'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'first')), + type: + NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'page')), + type: + NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'productsId')), + type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'ratings'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'first'), + value: VariableNode(name: NameNode(value: 'first'))), + ArgumentNode( + name: NameNode(value: 'page'), + value: VariableNode(name: NameNode(value: 'page'))), + ArgumentNode( + name: NameNode(value: 'product_id'), + value: VariableNode(name: NameNode(value: 'productsId'))) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'paginatorInfo'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'Paging'), directives: []) + ])), + FieldNode( + name: NameNode(value: 'data'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'rating'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'review'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'user'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'email'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'mobile'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ])) + ])), + FragmentDefinitionNode( + name: NameNode(value: 'Paging'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'PaginatorInfo'), isNonNull: false)), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'count'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'currentPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'firstItem'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'lastItem'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'hasMorePages'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'lastPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'perPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'total'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ]); + + @override + final String operationName = 'Ratings'; + + @override + final RatingsArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + Ratings$Query parse(Map json) => + Ratings$Query.fromJson(json); +} diff --git a/lib/generatedql/ratings/graphql_api.g.dart b/lib/generatedql/ratings/graphql_api.graphql.g.dart similarity index 53% rename from lib/generatedql/ratings/graphql_api.g.dart rename to lib/generatedql/ratings/graphql_api.graphql.g.dart index fe7364f..7e3cf17 100644 --- a/lib/generatedql/ratings/graphql_api.g.dart +++ b/lib/generatedql/ratings/graphql_api.graphql.g.dart @@ -1,41 +1,15 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'graphql_api.dart'; +part of 'graphql_api.graphql.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -Ratings _$RatingsFromJson(Map json) { - return Ratings() - ..ratings = json['ratings'] == null - ? null - : RatingPaginator.fromJson(json['ratings'] as Map); -} - -Map _$RatingsToJson(Ratings instance) => { - 'ratings': instance.ratings?.toJson(), - }; - -RatingPaginator _$RatingPaginatorFromJson(Map json) { - return RatingPaginator() - ..paginatorInfo = json['paginatorInfo'] == null - ? null - : PaginatorInfo.fromJson(json['paginatorInfo'] as Map) - ..data = (json['data'] as List) - ?.map((e) => - e == null ? null : Rating.fromJson(e as Map)) - ?.toList(); -} - -Map _$RatingPaginatorToJson(RatingPaginator instance) => - { - 'paginatorInfo': instance.paginatorInfo?.toJson(), - 'data': instance.data?.map((e) => e?.toJson())?.toList(), - }; - -PaginatorInfo _$PaginatorInfoFromJson(Map json) { - return PaginatorInfo() +Ratings$Query$RatingPaginator$PaginatorInfo + _$Ratings$Query$RatingPaginator$PaginatorInfoFromJson( + Map json) { + return Ratings$Query$RatingPaginator$PaginatorInfo() ..count = json['count'] as int ..currentPage = json['currentPage'] as int ..firstItem = json['firstItem'] as int @@ -46,7 +20,8 @@ PaginatorInfo _$PaginatorInfoFromJson(Map json) { ..total = json['total'] as int; } -Map _$PaginatorInfoToJson(PaginatorInfo instance) => +Map _$Ratings$Query$RatingPaginator$PaginatorInfoToJson( + Ratings$Query$RatingPaginator$PaginatorInfo instance) => { 'count': instance.count, 'currentPage': instance.currentPage, @@ -58,34 +33,77 @@ Map _$PaginatorInfoToJson(PaginatorInfo instance) => 'total': instance.total, }; -Rating _$RatingFromJson(Map json) { - return Rating() +Ratings$Query$RatingPaginator$Rating$User + _$Ratings$Query$RatingPaginator$Rating$UserFromJson( + Map json) { + return Ratings$Query$RatingPaginator$Rating$User() + ..id = json['id'] as String + ..name = json['name'] as String + ..email = json['email'] as String + ..mobile = json['mobile'] as String; +} + +Map _$Ratings$Query$RatingPaginator$Rating$UserToJson( + Ratings$Query$RatingPaginator$Rating$User instance) => + { + 'id': instance.id, + 'name': instance.name, + 'email': instance.email, + 'mobile': instance.mobile, + }; + +Ratings$Query$RatingPaginator$Rating + _$Ratings$Query$RatingPaginator$RatingFromJson(Map json) { + return Ratings$Query$RatingPaginator$Rating() ..rating = json['rating'] as int ..review = json['review'] as String ..user = json['user'] == null ? null - : User.fromJson(json['user'] as Map); + : Ratings$Query$RatingPaginator$Rating$User.fromJson( + json['user'] as Map); } -Map _$RatingToJson(Rating instance) => { +Map _$Ratings$Query$RatingPaginator$RatingToJson( + Ratings$Query$RatingPaginator$Rating instance) => + { 'rating': instance.rating, 'review': instance.review, 'user': instance.user?.toJson(), }; -User _$UserFromJson(Map json) { - return User() - ..id = json['id'] as String - ..name = json['name'] as String - ..email = json['email'] as String - ..mobile = json['mobile'] as String; +Ratings$Query$RatingPaginator _$Ratings$Query$RatingPaginatorFromJson( + Map json) { + return Ratings$Query$RatingPaginator() + ..paginatorInfo = json['paginatorInfo'] == null + ? null + : Ratings$Query$RatingPaginator$PaginatorInfo.fromJson( + json['paginatorInfo'] as Map) + ..data = (json['data'] as List) + ?.map((e) => e == null + ? null + : Ratings$Query$RatingPaginator$Rating.fromJson( + e as Map)) + ?.toList(); } -Map _$UserToJson(User instance) => { - 'id': instance.id, - 'name': instance.name, - 'email': instance.email, - 'mobile': instance.mobile, +Map _$Ratings$Query$RatingPaginatorToJson( + Ratings$Query$RatingPaginator instance) => + { + 'paginatorInfo': instance.paginatorInfo?.toJson(), + 'data': instance.data?.map((e) => e?.toJson())?.toList(), + }; + +Ratings$Query _$Ratings$QueryFromJson(Map json) { + return Ratings$Query() + ..ratings = json['ratings'] == null + ? null + : Ratings$Query$RatingPaginator.fromJson( + json['ratings'] as Map); +} + +Map _$Ratings$QueryToJson(Ratings$Query instance) => + { + 'ratings': instance.ratings?.toJson(), }; RatingsArguments _$RatingsArgumentsFromJson(Map json) { diff --git a/lib/generatedql/related_product/graphql_api.dart b/lib/generatedql/related_product/graphql_api.dart index 4cee68d..196c5cd 100644 --- a/lib/generatedql/related_product/graphql_api.dart +++ b/lib/generatedql/related_product/graphql_api.dart @@ -1,286 +1,2 @@ // GENERATED CODE - DO NOT MODIFY BY HAND - -import 'package:artemis/artemis.dart'; -import 'package:json_annotation/json_annotation.dart'; -import 'package:equatable/equatable.dart'; -import 'package:gql/ast.dart'; -part 'graphql_api.g.dart'; - -mixin ProductMixin { - String id; - String averageRating; - String price; - bool available; - ProductData details; -} - -@JsonSerializable(explicitToJson: true) -class RelatedProducts with EquatableMixin { - RelatedProducts(); - - factory RelatedProducts.fromJson(Map json) => - _$RelatedProductsFromJson(json); - - List relatedProducts; - - @override - List get props => [relatedProducts]; - Map toJson() => _$RelatedProductsToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Product with EquatableMixin, ProductMixin { - Product(); - - factory Product.fromJson(Map json) => - _$ProductFromJson(json); - - @override - List get props => [id, averageRating, price, available, details]; - Map toJson() => _$ProductToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class ProductData with EquatableMixin { - ProductData(); - - factory ProductData.fromJson(Map json) => - _$ProductDataFromJson(json); - - String name; - - String sku; - - String description; - - Media cover; - - Unit unit; - - List media; - - Category category; - - @override - List get props => - [name, sku, description, cover, unit, media, category]; - Map toJson() => _$ProductDataToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Media with EquatableMixin { - Media(); - - factory Media.fromJson(Map json) => _$MediaFromJson(json); - - String url; - - @override - List get props => [url]; - Map toJson() => _$MediaToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Unit with EquatableMixin { - Unit(); - - factory Unit.fromJson(Map json) => _$UnitFromJson(json); - - String id; - - String name; - - @override - List get props => [id, name]; - Map toJson() => _$UnitToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class Category with EquatableMixin { - Category(); - - factory Category.fromJson(Map json) => - _$CategoryFromJson(json); - - String id; - - @override - List get props => [id]; - Map toJson() => _$CategoryToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class RelatedProductsArguments extends JsonSerializable with EquatableMixin { - RelatedProductsArguments({this.id}); - - factory RelatedProductsArguments.fromJson(Map json) => - _$RelatedProductsArgumentsFromJson(json); - - final String id; - - @override - List get props => [id]; - Map toJson() => _$RelatedProductsArgumentsToJson(this); -} - -class RelatedProductsQuery - extends GraphQLQuery { - RelatedProductsQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'RelatedProducts'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'id')), - type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'relatedProducts'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'id'), - value: VariableNode(name: NameNode(value: 'id'))) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FragmentSpreadNode( - name: NameNode(value: 'Product'), directives: []) - ])) - ])), - FragmentDefinitionNode( - name: NameNode(value: 'Product'), - typeCondition: TypeConditionNode( - on: NamedTypeNode( - name: NameNode(value: 'Product'), isNonNull: false)), - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'averageRating'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'price'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'available'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'details'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'sku'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'description'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'cover'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'url'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'unit'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'media'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'url'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'category'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ])) - ]); - - @override - final String operationName = 'RelatedProducts'; - - @override - final RelatedProductsArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - RelatedProducts parse(Map json) => - RelatedProducts.fromJson(json); -} +export 'graphql_api.graphql.dart'; diff --git a/lib/generatedql/related_product/graphql_api.g.dart b/lib/generatedql/related_product/graphql_api.g.dart deleted file mode 100644 index 03a315f..0000000 --- a/lib/generatedql/related_product/graphql_api.g.dart +++ /dev/null @@ -1,111 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'graphql_api.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -RelatedProducts _$RelatedProductsFromJson(Map json) { - return RelatedProducts() - ..relatedProducts = (json['relatedProducts'] as List) - ?.map((e) => - e == null ? null : Product.fromJson(e as Map)) - ?.toList(); -} - -Map _$RelatedProductsToJson(RelatedProducts instance) => - { - 'relatedProducts': - instance.relatedProducts?.map((e) => e?.toJson())?.toList(), - }; - -Product _$ProductFromJson(Map json) { - return Product() - ..id = json['id'] as String - ..averageRating = json['averageRating'] as String - ..price = json['price'] as String - ..available = json['available'] as bool - ..details = json['details'] == null - ? null - : ProductData.fromJson(json['details'] as Map); -} - -Map _$ProductToJson(Product instance) => { - 'id': instance.id, - 'averageRating': instance.averageRating, - 'price': instance.price, - 'available': instance.available, - 'details': instance.details?.toJson(), - }; - -ProductData _$ProductDataFromJson(Map json) { - return ProductData() - ..name = json['name'] as String - ..sku = json['sku'] as String - ..description = json['description'] as String - ..cover = json['cover'] == null - ? null - : Media.fromJson(json['cover'] as Map) - ..unit = json['unit'] == null - ? null - : Unit.fromJson(json['unit'] as Map) - ..media = (json['media'] as List) - ?.map( - (e) => e == null ? null : Media.fromJson(e as Map)) - ?.toList() - ..category = json['category'] == null - ? null - : Category.fromJson(json['category'] as Map); -} - -Map _$ProductDataToJson(ProductData instance) => - { - 'name': instance.name, - 'sku': instance.sku, - 'description': instance.description, - 'cover': instance.cover?.toJson(), - 'unit': instance.unit?.toJson(), - 'media': instance.media?.map((e) => e?.toJson())?.toList(), - 'category': instance.category?.toJson(), - }; - -Media _$MediaFromJson(Map json) { - return Media()..url = json['url'] as String; -} - -Map _$MediaToJson(Media instance) => { - 'url': instance.url, - }; - -Unit _$UnitFromJson(Map json) { - return Unit() - ..id = json['id'] as String - ..name = json['name'] as String; -} - -Map _$UnitToJson(Unit instance) => { - 'id': instance.id, - 'name': instance.name, - }; - -Category _$CategoryFromJson(Map json) { - return Category()..id = json['id'] as String; -} - -Map _$CategoryToJson(Category instance) => { - 'id': instance.id, - }; - -RelatedProductsArguments _$RelatedProductsArgumentsFromJson( - Map json) { - return RelatedProductsArguments( - id: json['id'] as String, - ); -} - -Map _$RelatedProductsArgumentsToJson( - RelatedProductsArguments instance) => - { - 'id': instance.id, - }; diff --git a/lib/generatedql/related_product/graphql_api.graphql.dart b/lib/generatedql/related_product/graphql_api.graphql.dart new file mode 100644 index 0000000..4f809ff --- /dev/null +++ b/lib/generatedql/related_product/graphql_api.graphql.dart @@ -0,0 +1,293 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +import 'package:meta/meta.dart'; +import 'package:artemis/artemis.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:equatable/equatable.dart'; +import 'package:gql/ast.dart'; +part 'graphql_api.graphql.g.dart'; + +mixin ProductMixin { + String id; + String averageRating; + String price; + bool available; + ProductMixin$ProductData details; +} + +@JsonSerializable(explicitToJson: true) +class RelatedProducts$Query$Product with EquatableMixin, ProductMixin { + RelatedProducts$Query$Product(); + + factory RelatedProducts$Query$Product.fromJson(Map json) => + _$RelatedProducts$Query$ProductFromJson(json); + + @override + List get props => [id, averageRating, price, available, details]; + Map toJson() => _$RelatedProducts$Query$ProductToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class RelatedProducts$Query with EquatableMixin { + RelatedProducts$Query(); + + factory RelatedProducts$Query.fromJson(Map json) => + _$RelatedProducts$QueryFromJson(json); + + List relatedProducts; + + @override + List get props => [relatedProducts]; + Map toJson() => _$RelatedProducts$QueryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ProductMixin$ProductData$Media with EquatableMixin { + ProductMixin$ProductData$Media(); + + factory ProductMixin$ProductData$Media.fromJson(Map json) => + _$ProductMixin$ProductData$MediaFromJson(json); + + String url; + + @override + List get props => [url]; + Map toJson() => _$ProductMixin$ProductData$MediaToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ProductMixin$ProductData$Unit with EquatableMixin { + ProductMixin$ProductData$Unit(); + + factory ProductMixin$ProductData$Unit.fromJson(Map json) => + _$ProductMixin$ProductData$UnitFromJson(json); + + String id; + + String name; + + @override + List get props => [id, name]; + Map toJson() => _$ProductMixin$ProductData$UnitToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ProductMixin$ProductData$Category with EquatableMixin { + ProductMixin$ProductData$Category(); + + factory ProductMixin$ProductData$Category.fromJson( + Map json) => + _$ProductMixin$ProductData$CategoryFromJson(json); + + String id; + + @override + List get props => [id]; + Map toJson() => + _$ProductMixin$ProductData$CategoryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class ProductMixin$ProductData with EquatableMixin { + ProductMixin$ProductData(); + + factory ProductMixin$ProductData.fromJson(Map json) => + _$ProductMixin$ProductDataFromJson(json); + + String name; + + String sku; + + String description; + + ProductMixin$ProductData$Media cover; + + ProductMixin$ProductData$Unit unit; + + List media; + + ProductMixin$ProductData$Category category; + + @override + List get props => + [name, sku, description, cover, unit, media, category]; + Map toJson() => _$ProductMixin$ProductDataToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class RelatedProductsArguments extends JsonSerializable with EquatableMixin { + RelatedProductsArguments({@required this.id}); + + @override + factory RelatedProductsArguments.fromJson(Map json) => + _$RelatedProductsArgumentsFromJson(json); + + final String id; + + @override + List get props => [id]; + @override + Map toJson() => _$RelatedProductsArgumentsToJson(this); +} + +class RelatedProductsQuery + extends GraphQLQuery { + RelatedProductsQuery({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'RelatedProducts'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'id')), + type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'relatedProducts'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'id'), + value: VariableNode(name: NameNode(value: 'id'))) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'Product'), directives: []) + ])) + ])), + FragmentDefinitionNode( + name: NameNode(value: 'Product'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'Product'), isNonNull: false)), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'averageRating'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'price'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'available'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'details'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'sku'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'description'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'cover'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'url'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'unit'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'media'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'url'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'category'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ])) + ]); + + @override + final String operationName = 'RelatedProducts'; + + @override + final RelatedProductsArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + RelatedProducts$Query parse(Map json) => + RelatedProducts$Query.fromJson(json); +} diff --git a/lib/generatedql/related_product/graphql_api.graphql.g.dart b/lib/generatedql/related_product/graphql_api.graphql.g.dart new file mode 100644 index 0000000..26646b4 --- /dev/null +++ b/lib/generatedql/related_product/graphql_api.graphql.g.dart @@ -0,0 +1,134 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'graphql_api.graphql.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RelatedProducts$Query$Product _$RelatedProducts$Query$ProductFromJson( + Map json) { + return RelatedProducts$Query$Product() + ..id = json['id'] as String + ..averageRating = json['averageRating'] as String + ..price = json['price'] as String + ..available = json['available'] as bool + ..details = json['details'] == null + ? null + : ProductMixin$ProductData.fromJson( + json['details'] as Map); +} + +Map _$RelatedProducts$Query$ProductToJson( + RelatedProducts$Query$Product instance) => + { + 'id': instance.id, + 'averageRating': instance.averageRating, + 'price': instance.price, + 'available': instance.available, + 'details': instance.details?.toJson(), + }; + +RelatedProducts$Query _$RelatedProducts$QueryFromJson( + Map json) { + return RelatedProducts$Query() + ..relatedProducts = (json['relatedProducts'] as List) + ?.map((e) => e == null + ? null + : RelatedProducts$Query$Product.fromJson(e as Map)) + ?.toList(); +} + +Map _$RelatedProducts$QueryToJson( + RelatedProducts$Query instance) => + { + 'relatedProducts': + instance.relatedProducts?.map((e) => e?.toJson())?.toList(), + }; + +ProductMixin$ProductData$Media _$ProductMixin$ProductData$MediaFromJson( + Map json) { + return ProductMixin$ProductData$Media()..url = json['url'] as String; +} + +Map _$ProductMixin$ProductData$MediaToJson( + ProductMixin$ProductData$Media instance) => + { + 'url': instance.url, + }; + +ProductMixin$ProductData$Unit _$ProductMixin$ProductData$UnitFromJson( + Map json) { + return ProductMixin$ProductData$Unit() + ..id = json['id'] as String + ..name = json['name'] as String; +} + +Map _$ProductMixin$ProductData$UnitToJson( + ProductMixin$ProductData$Unit instance) => + { + 'id': instance.id, + 'name': instance.name, + }; + +ProductMixin$ProductData$Category _$ProductMixin$ProductData$CategoryFromJson( + Map json) { + return ProductMixin$ProductData$Category()..id = json['id'] as String; +} + +Map _$ProductMixin$ProductData$CategoryToJson( + ProductMixin$ProductData$Category instance) => + { + 'id': instance.id, + }; + +ProductMixin$ProductData _$ProductMixin$ProductDataFromJson( + Map json) { + return ProductMixin$ProductData() + ..name = json['name'] as String + ..sku = json['sku'] as String + ..description = json['description'] as String + ..cover = json['cover'] == null + ? null + : ProductMixin$ProductData$Media.fromJson( + json['cover'] as Map) + ..unit = json['unit'] == null + ? null + : ProductMixin$ProductData$Unit.fromJson( + json['unit'] as Map) + ..media = (json['media'] as List) + ?.map((e) => e == null + ? null + : ProductMixin$ProductData$Media.fromJson( + e as Map)) + ?.toList() + ..category = json['category'] == null + ? null + : ProductMixin$ProductData$Category.fromJson( + json['category'] as Map); +} + +Map _$ProductMixin$ProductDataToJson( + ProductMixin$ProductData instance) => + { + 'name': instance.name, + 'sku': instance.sku, + 'description': instance.description, + 'cover': instance.cover?.toJson(), + 'unit': instance.unit?.toJson(), + 'media': instance.media?.map((e) => e?.toJson())?.toList(), + 'category': instance.category?.toJson(), + }; + +RelatedProductsArguments _$RelatedProductsArgumentsFromJson( + Map json) { + return RelatedProductsArguments( + id: json['id'] as String, + ); +} + +Map _$RelatedProductsArgumentsToJson( + RelatedProductsArguments instance) => + { + 'id': instance.id, + }; diff --git a/lib/generatedql/user/graphql_api.dart b/lib/generatedql/user/graphql_api.dart index cdaf160..196c5cd 100644 --- a/lib/generatedql/user/graphql_api.dart +++ b/lib/generatedql/user/graphql_api.dart @@ -1,300 +1,2 @@ // GENERATED CODE - DO NOT MODIFY BY HAND - -import 'package:artemis/artemis.dart'; -import 'package:json_annotation/json_annotation.dart'; -import 'package:equatable/equatable.dart'; -import 'package:gql/ast.dart'; -part 'graphql_api.g.dart'; - -@JsonSerializable(explicitToJson: true) -class RefreshToken with EquatableMixin { - RefreshToken(); - - factory RefreshToken.fromJson(Map json) => - _$RefreshTokenFromJson(json); - - AuthPayload refreshToken; - - @override - List get props => [refreshToken]; - Map toJson() => _$RefreshTokenToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class AuthPayload with EquatableMixin { - AuthPayload(); - - factory AuthPayload.fromJson(Map json) => - _$AuthPayloadFromJson(json); - - String access_token; - - String refresh_token; - - int expires_in; - - String token_type; - - @override - List get props => - [access_token, refresh_token, expires_in, token_type]; - Map toJson() => _$AuthPayloadToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class RefreshTokenArguments extends JsonSerializable with EquatableMixin { - RefreshTokenArguments({this.token}); - - factory RefreshTokenArguments.fromJson(Map json) => - _$RefreshTokenArgumentsFromJson(json); - - final String token; - - @override - List get props => [token]; - Map toJson() => _$RefreshTokenArgumentsToJson(this); -} - -class RefreshTokenQuery - extends GraphQLQuery { - RefreshTokenQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.mutation, - name: NameNode(value: 'RefreshToken'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'token')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'refreshToken'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'token'), - value: VariableNode(name: NameNode(value: 'token'))) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'access_token'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'refresh_token'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'expires_in'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'token_type'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ]); - - @override - final String operationName = 'RefreshToken'; - - @override - final RefreshTokenArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - RefreshToken parse(Map json) => RefreshToken.fromJson(json); -} - -@JsonSerializable(explicitToJson: true) -class Profile with EquatableMixin { - Profile(); - - factory Profile.fromJson(Map json) => - _$ProfileFromJson(json); - - User profile; - - @override - List get props => [profile]; - Map toJson() => _$ProfileToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class User with EquatableMixin { - User(); - - factory User.fromJson(Map json) => _$UserFromJson(json); - - String id; - - String name; - - String email; - - String mobile; - - @override - List get props => [id, name, email, mobile]; - Map toJson() => _$UserToJson(this); -} - -class ProfileQuery extends GraphQLQuery { - ProfileQuery(); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'Profile'), - variableDefinitions: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'profile'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'email'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'mobile'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ]); - - @override - final String operationName = 'Profile'; - - @override - List get props => [document, operationName]; - @override - Profile parse(Map json) => Profile.fromJson(json); -} - -@JsonSerializable(explicitToJson: true) -class UpdateProfile with EquatableMixin { - UpdateProfile(); - - factory UpdateProfile.fromJson(Map json) => - _$UpdateProfileFromJson(json); - - bool updateProfile; - - @override - List get props => [updateProfile]; - Map toJson() => _$UpdateProfileToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class UpdateProfileArguments extends JsonSerializable with EquatableMixin { - UpdateProfileArguments({this.name, this.mobile}); - - factory UpdateProfileArguments.fromJson(Map json) => - _$UpdateProfileArgumentsFromJson(json); - - final String name; - - final String mobile; - - @override - List get props => [name, mobile]; - Map toJson() => _$UpdateProfileArgumentsToJson(this); -} - -class UpdateProfileQuery - extends GraphQLQuery { - UpdateProfileQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.mutation, - name: NameNode(value: 'UpdateProfile'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'name')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'mobile')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'updateProfile'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'input'), - value: ObjectValueNode(fields: [ - ObjectFieldNode( - name: NameNode(value: 'name'), - value: VariableNode(name: NameNode(value: 'name'))), - ObjectFieldNode( - name: NameNode(value: 'mobile'), - value: VariableNode(name: NameNode(value: 'mobile'))) - ])) - ], - directives: [], - selectionSet: null) - ])) - ]); - - @override - final String operationName = 'UpdateProfile'; - - @override - final UpdateProfileArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - UpdateProfile parse(Map json) => - UpdateProfile.fromJson(json); -} +export 'graphql_api.graphql.dart'; diff --git a/lib/generatedql/user/graphql_api.g.dart b/lib/generatedql/user/graphql_api.g.dart deleted file mode 100644 index 5565def..0000000 --- a/lib/generatedql/user/graphql_api.g.dart +++ /dev/null @@ -1,98 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'graphql_api.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -RefreshToken _$RefreshTokenFromJson(Map json) { - return RefreshToken() - ..refreshToken = json['refreshToken'] == null - ? null - : AuthPayload.fromJson(json['refreshToken'] as Map); -} - -Map _$RefreshTokenToJson(RefreshToken instance) => - { - 'refreshToken': instance.refreshToken?.toJson(), - }; - -AuthPayload _$AuthPayloadFromJson(Map json) { - return AuthPayload() - ..access_token = json['access_token'] as String - ..refresh_token = json['refresh_token'] as String - ..expires_in = json['expires_in'] as int - ..token_type = json['token_type'] as String; -} - -Map _$AuthPayloadToJson(AuthPayload instance) => - { - 'access_token': instance.access_token, - 'refresh_token': instance.refresh_token, - 'expires_in': instance.expires_in, - 'token_type': instance.token_type, - }; - -RefreshTokenArguments _$RefreshTokenArgumentsFromJson( - Map json) { - return RefreshTokenArguments( - token: json['token'] as String, - ); -} - -Map _$RefreshTokenArgumentsToJson( - RefreshTokenArguments instance) => - { - 'token': instance.token, - }; - -Profile _$ProfileFromJson(Map json) { - return Profile() - ..profile = json['profile'] == null - ? null - : User.fromJson(json['profile'] as Map); -} - -Map _$ProfileToJson(Profile instance) => { - 'profile': instance.profile?.toJson(), - }; - -User _$UserFromJson(Map json) { - return User() - ..id = json['id'] as String - ..name = json['name'] as String - ..email = json['email'] as String - ..mobile = json['mobile'] as String; -} - -Map _$UserToJson(User instance) => { - 'id': instance.id, - 'name': instance.name, - 'email': instance.email, - 'mobile': instance.mobile, - }; - -UpdateProfile _$UpdateProfileFromJson(Map json) { - return UpdateProfile()..updateProfile = json['updateProfile'] as bool; -} - -Map _$UpdateProfileToJson(UpdateProfile instance) => - { - 'updateProfile': instance.updateProfile, - }; - -UpdateProfileArguments _$UpdateProfileArgumentsFromJson( - Map json) { - return UpdateProfileArguments( - name: json['name'] as String, - mobile: json['mobile'] as String, - ); -} - -Map _$UpdateProfileArgumentsToJson( - UpdateProfileArguments instance) => - { - 'name': instance.name, - 'mobile': instance.mobile, - }; diff --git a/lib/generatedql/user/graphql_api.graphql.dart b/lib/generatedql/user/graphql_api.graphql.dart new file mode 100644 index 0000000..960f0fb --- /dev/null +++ b/lib/generatedql/user/graphql_api.graphql.dart @@ -0,0 +1,313 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +import 'package:meta/meta.dart'; +import 'package:artemis/artemis.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:equatable/equatable.dart'; +import 'package:gql/ast.dart'; +part 'graphql_api.graphql.g.dart'; + +@JsonSerializable(explicitToJson: true) +class RefreshToken$Mutation$AuthPayload with EquatableMixin { + RefreshToken$Mutation$AuthPayload(); + + factory RefreshToken$Mutation$AuthPayload.fromJson( + Map json) => + _$RefreshToken$Mutation$AuthPayloadFromJson(json); + + @JsonKey(name: 'access_token') + String accessToken; + + @JsonKey(name: 'refresh_token') + String refreshToken; + + @JsonKey(name: 'expires_in') + int expiresIn; + + @JsonKey(name: 'token_type') + String tokenType; + + @override + List get props => [accessToken, refreshToken, expiresIn, tokenType]; + Map toJson() => + _$RefreshToken$Mutation$AuthPayloadToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class RefreshToken$Mutation with EquatableMixin { + RefreshToken$Mutation(); + + factory RefreshToken$Mutation.fromJson(Map json) => + _$RefreshToken$MutationFromJson(json); + + RefreshToken$Mutation$AuthPayload refreshToken; + + @override + List get props => [refreshToken]; + Map toJson() => _$RefreshToken$MutationToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Profile$Query$User with EquatableMixin { + Profile$Query$User(); + + factory Profile$Query$User.fromJson(Map json) => + _$Profile$Query$UserFromJson(json); + + String id; + + String name; + + String email; + + String mobile; + + @override + List get props => [id, name, email, mobile]; + Map toJson() => _$Profile$Query$UserToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Profile$Query with EquatableMixin { + Profile$Query(); + + factory Profile$Query.fromJson(Map json) => + _$Profile$QueryFromJson(json); + + Profile$Query$User profile; + + @override + List get props => [profile]; + Map toJson() => _$Profile$QueryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class UpdateProfile$Mutation with EquatableMixin { + UpdateProfile$Mutation(); + + factory UpdateProfile$Mutation.fromJson(Map json) => + _$UpdateProfile$MutationFromJson(json); + + bool updateProfile; + + @override + List get props => [updateProfile]; + Map toJson() => _$UpdateProfile$MutationToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class RefreshTokenArguments extends JsonSerializable with EquatableMixin { + RefreshTokenArguments({@required this.token}); + + @override + factory RefreshTokenArguments.fromJson(Map json) => + _$RefreshTokenArgumentsFromJson(json); + + final String token; + + @override + List get props => [token]; + @override + Map toJson() => _$RefreshTokenArgumentsToJson(this); +} + +class RefreshTokenMutation + extends GraphQLQuery { + RefreshTokenMutation({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'RefreshToken'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'token')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'refreshToken'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'token'), + value: VariableNode(name: NameNode(value: 'token'))) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'access_token'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'refresh_token'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'expires_in'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'token_type'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ]); + + @override + final String operationName = 'RefreshToken'; + + @override + final RefreshTokenArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + RefreshToken$Mutation parse(Map json) => + RefreshToken$Mutation.fromJson(json); +} + +class ProfileQuery extends GraphQLQuery { + ProfileQuery(); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'Profile'), + variableDefinitions: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'profile'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'email'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'mobile'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ]); + + @override + final String operationName = 'Profile'; + + @override + List get props => [document, operationName]; + @override + Profile$Query parse(Map json) => + Profile$Query.fromJson(json); +} + +@JsonSerializable(explicitToJson: true) +class UpdateProfileArguments extends JsonSerializable with EquatableMixin { + UpdateProfileArguments({@required this.name, @required this.mobile}); + + @override + factory UpdateProfileArguments.fromJson(Map json) => + _$UpdateProfileArgumentsFromJson(json); + + final String name; + + final String mobile; + + @override + List get props => [name, mobile]; + @override + Map toJson() => _$UpdateProfileArgumentsToJson(this); +} + +class UpdateProfileMutation + extends GraphQLQuery { + UpdateProfileMutation({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'UpdateProfile'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'name')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'mobile')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'updateProfile'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'input'), + value: ObjectValueNode(fields: [ + ObjectFieldNode( + name: NameNode(value: 'name'), + value: VariableNode(name: NameNode(value: 'name'))), + ObjectFieldNode( + name: NameNode(value: 'mobile'), + value: VariableNode(name: NameNode(value: 'mobile'))) + ])) + ], + directives: [], + selectionSet: null) + ])) + ]); + + @override + final String operationName = 'UpdateProfile'; + + @override + final UpdateProfileArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + UpdateProfile$Mutation parse(Map json) => + UpdateProfile$Mutation.fromJson(json); +} diff --git a/lib/generatedql/user/graphql_api.graphql.g.dart b/lib/generatedql/user/graphql_api.graphql.g.dart new file mode 100644 index 0000000..a7bf27a --- /dev/null +++ b/lib/generatedql/user/graphql_api.graphql.g.dart @@ -0,0 +1,108 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'graphql_api.graphql.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RefreshToken$Mutation$AuthPayload _$RefreshToken$Mutation$AuthPayloadFromJson( + Map json) { + return RefreshToken$Mutation$AuthPayload() + ..accessToken = json['access_token'] as String + ..refreshToken = json['refresh_token'] as String + ..expiresIn = json['expires_in'] as int + ..tokenType = json['token_type'] as String; +} + +Map _$RefreshToken$Mutation$AuthPayloadToJson( + RefreshToken$Mutation$AuthPayload instance) => + { + 'access_token': instance.accessToken, + 'refresh_token': instance.refreshToken, + 'expires_in': instance.expiresIn, + 'token_type': instance.tokenType, + }; + +RefreshToken$Mutation _$RefreshToken$MutationFromJson( + Map json) { + return RefreshToken$Mutation() + ..refreshToken = json['refreshToken'] == null + ? null + : RefreshToken$Mutation$AuthPayload.fromJson( + json['refreshToken'] as Map); +} + +Map _$RefreshToken$MutationToJson( + RefreshToken$Mutation instance) => + { + 'refreshToken': instance.refreshToken?.toJson(), + }; + +Profile$Query$User _$Profile$Query$UserFromJson(Map json) { + return Profile$Query$User() + ..id = json['id'] as String + ..name = json['name'] as String + ..email = json['email'] as String + ..mobile = json['mobile'] as String; +} + +Map _$Profile$Query$UserToJson(Profile$Query$User instance) => + { + 'id': instance.id, + 'name': instance.name, + 'email': instance.email, + 'mobile': instance.mobile, + }; + +Profile$Query _$Profile$QueryFromJson(Map json) { + return Profile$Query() + ..profile = json['profile'] == null + ? null + : Profile$Query$User.fromJson(json['profile'] as Map); +} + +Map _$Profile$QueryToJson(Profile$Query instance) => + { + 'profile': instance.profile?.toJson(), + }; + +UpdateProfile$Mutation _$UpdateProfile$MutationFromJson( + Map json) { + return UpdateProfile$Mutation() + ..updateProfile = json['updateProfile'] as bool; +} + +Map _$UpdateProfile$MutationToJson( + UpdateProfile$Mutation instance) => + { + 'updateProfile': instance.updateProfile, + }; + +RefreshTokenArguments _$RefreshTokenArgumentsFromJson( + Map json) { + return RefreshTokenArguments( + token: json['token'] as String, + ); +} + +Map _$RefreshTokenArgumentsToJson( + RefreshTokenArguments instance) => + { + 'token': instance.token, + }; + +UpdateProfileArguments _$UpdateProfileArgumentsFromJson( + Map json) { + return UpdateProfileArguments( + name: json['name'] as String, + mobile: json['mobile'] as String, + ); +} + +Map _$UpdateProfileArgumentsToJson( + UpdateProfileArguments instance) => + { + 'name': instance.name, + 'mobile': instance.mobile, + }; diff --git a/lib/mmd_ecommerce.dart b/lib/mmd_ecommerce.dart index c7e2016..e515951 100644 --- a/lib/mmd_ecommerce.dart +++ b/lib/mmd_ecommerce.dart @@ -12,29 +12,38 @@ export './apis/product_api_manager.dart'; export './apis/cart_api_manager.dart'; export './apis/address_api_manager.dart'; export './common_models/common_models.dart'; +export './generatedql/products/graphql_api.dart'; export './generatedql/order_products/graphql_api.dart' - hide PaginatorInfo, Category, Media, Product, Unit; -export './generatedql/products/graphql_api.dart' hide - Media, - Category, - Product, - ProductPaginator, - ProductData, PagingMixin, - ProductMixin; + ProductMixin, + ProductMixin$ProductData$Unit, + ProductMixin$ProductData$Media, + ProductMixin$ProductData, + ProductMixin$ProductData$Category; + export './generatedql/cart/graphql_api.dart' - hide Media, ProductData, Product, Unit, ProductMixin, Category; + hide + ProductMixin, + ProductMixin$ProductData$Unit, + ProductMixin$ProductData$Media, + ProductMixin$ProductData, + ProductMixin$ProductData$Category; export './generatedql/related_product/graphql_api.dart' - hide Media, Category, ProductData, Unit, Product, ProductMixin; -export './generatedql/ratings/graphql_api.dart' - hide PaginatorInfo, User, PagingMixin; + hide + ProductMixin, + ProductMixin$ProductData$Unit, + ProductMixin$ProductData$Media, + ProductMixin$ProductData, + ProductMixin$ProductData$Category; +export './generatedql/ratings/graphql_api.dart' hide PagingMixin; export './generatedql/categories/graphql_api.dart'; -export './generatedql/orders/graphql_api.dart' hide PaginatorInfo, PagingMixin; -export './generatedql/auth/graphql_api.dart' hide AuthPayload, User; -export './generatedql/general/graphql_api.dart' hide Media; -export './generatedql/user/graphql_api.dart' hide AuthPayload, User; -export './generatedql/address/graphql_api.dart' hide PagingMixin, PaginatorInfo; +export './generatedql/orders/graphql_api.dart' hide PagingMixin; +export './generatedql/auth/graphql_api.dart'; +export './generatedql/general/graphql_api.dart'; +export './generatedql/user/graphql_api.dart'; +export './generatedql/address_asset/graphql_api.dart'; +export './generatedql/address/graphql_api.dart' hide PagingMixin; export './mmd_ecommerce.dart'; export './mmd_ecommerce_fl_lib.dart'; diff --git a/pubspec.lock b/pubspec.lock index 7a08a86..8a6341a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -168,7 +168,7 @@ packages: name: connectivity_macos url: "https://pub.dartlang.org" source: hosted - version: "0.1.0+4" + version: "0.1.0+5" connectivity_platform_interface: dependency: transitive description: @@ -210,7 +210,7 @@ packages: name: equatable url: "https://pub.dartlang.org" source: hosted - version: "1.2.4" + version: "1.2.5" fake_async: dependency: transitive description: @@ -218,6 +218,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0-nullsafety" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" file: dependency: transitive description: @@ -442,7 +449,7 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "1.6.14" + version: "1.6.16" path_provider_linux: dependency: transitive description: @@ -456,7 +463,7 @@ packages: name: path_provider_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.4+3" + version: "0.0.4+4" path_provider_platform_interface: dependency: transitive description: @@ -464,6 +471,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.3" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.2" pedantic: dependency: transitive description: @@ -658,6 +672,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.0.5" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.1" xdg_directories: dependency: transitive description: From a6a86d3a273c792dd705352c59a8065b0e583e5f Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Sat, 19 Sep 2020 16:17:26 +0200 Subject: [PATCH 05/24] update equatable version --- pubspec.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 35df331..4b32726 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,16 +12,16 @@ dependencies: flutter: sdk: flutter json_serializable: ^3.2.3 - equatable: ^1.0.2 - gql: '>=0.7.3 <1.0.0' # update according to DOCS https://pub.dev/packages/artemis/versions/6.12.3-beta.1#installation + equatable: ^1.2.5 + gql: ">=0.7.3 <1.0.0" # update according to DOCS https://pub.dev/packages/artemis/versions/6.12.3-beta.1#installation meta: ">=1.0.0 <2.0.0" # only if you have non nullable fields path_provider: ^1.5.1 graphql_flutter: ^3.1.0 analyzer: ^0.39.2+1 artemis: ^6.12.3-beta.1 - # add beta because have a Exception: Two classes were generated with the same name - # according to https://github.com/comigor/artemis/issues/194#issuecomment-670576452 - # use the latest beta version + # add beta because have a Exception: Two classes were generated with the same name + # according to https://github.com/comigor/artemis/issues/194#issuecomment-670576452 + # use the latest beta version json_annotation: ^3.0.1 http: ^0.12.0+4 From a021b29526a9e1ad89cde15676ea75814fb319cf Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Mon, 21 Sep 2020 18:02:15 +0200 Subject: [PATCH 06/24] fixed login error --- .vscode/settings.json | 20 -------------------- example/lib/main.dart | 9 ++------- example/pubspec.lock | 4 ++-- lib/apis/address_api_manager.dart | 3 --- pubspec.lock | 4 ++-- 5 files changed, 6 insertions(+), 34 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 737d94e..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "cSpell.enableFiletypes": [ - "dart", - "graphql", - "ignore", - "json5", - "kotlin", - "kotlinscript", - "log", - "objective-c", - "objective-cpp", - "pip-requirements", - "powershell", - "search-result", - "shellscript", - "sql", - "swift", - "xml" - ] -} \ No newline at end of file diff --git a/example/lib/main.dart b/example/lib/main.dart index f7a2cd8..3725baa 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -228,16 +228,11 @@ class _MyHomePageState extends State { } callLoginApi() async { - await AuthApiManager.loginApi("test@mail.com", "1234567890", "123", + await AuthApiManager.loginApi("test@mail.com", "123456789", "123", (SignIn$Mutation$AuthPayload authPayload) async { auth = authPayload; MmdECommerceFlLib.submitTokeAndTokenType( authPayload.accessToken, authPayload.tokenType); - }, (ApiErrorModel error) { - print(error.errorCode); - print(error.errorMessage); - print(error.queryResult.exception); - print(error.queryResult.data); - }); + }, (ApiErrorModel error) {}); } } diff --git a/example/pubspec.lock b/example/pubspec.lock index 7c9ca2f..bb76951 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -442,7 +442,7 @@ packages: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.2" + version: "0.0.3" pedantic: dependency: transitive description: @@ -601,7 +601,7 @@ packages: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "1.7.1" + version: "1.7.3" xdg_directories: dependency: transitive description: diff --git a/lib/apis/address_api_manager.dart b/lib/apis/address_api_manager.dart index 6bebb6c..ade9888 100644 --- a/lib/apis/address_api_manager.dart +++ b/lib/apis/address_api_manager.dart @@ -4,9 +4,6 @@ import 'package:mmd_ecommerce_fl_lib/generatedql/address/graphql_api.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/address_asset/graphql_api.dart'; import '../generatedql/address_asset/graphql_api.dart'; import '../mmd_ecommerce.dart'; -import '../mmd_ecommerce.dart'; -import '../mmd_ecommerce.dart'; -import '../mmd_ecommerce.dart'; import 'error/api_error_helper.dart'; class AddressApiManager extends BaseApiManager { diff --git a/pubspec.lock b/pubspec.lock index 8a6341a..00d2966 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -477,7 +477,7 @@ packages: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.2" + version: "0.0.3" pedantic: dependency: transitive description: @@ -678,7 +678,7 @@ packages: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "1.7.1" + version: "1.7.3" xdg_directories: dependency: transitive description: From 9603bfd9c0f07ef4151d351e4a28a56826abdbb9 Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Thu, 24 Sep 2020 12:36:42 +0200 Subject: [PATCH 07/24] update pubspec.yaml and path_provider version --- .vscode/launch.json | 15 +++++++++++++++ example/pubspec.lock | 20 ++++++++++---------- pubspec.lock | 18 +++++++++--------- pubspec.yaml | 4 ++-- 4 files changed, 36 insertions(+), 21 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..7a9dfa0 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "pwa-chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:8080", + "webRoot": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/example/pubspec.lock b/example/pubspec.lock index bb76951..4abef36 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -49,7 +49,7 @@ packages: name: build url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.5.0" build_config: dependency: transitive description: @@ -126,7 +126,7 @@ packages: name: connectivity url: "https://pub.dartlang.org" source: hosted - version: "0.4.9+2" + version: "0.4.9+3" connectivity_for_web: dependency: transitive description: @@ -246,7 +246,7 @@ packages: name: gql url: "https://pub.dartlang.org" source: hosted - version: "0.12.4-alpha+1599667008836" + version: "0.12.4-alpha+1600790194928" gql_code_gen: dependency: transitive description: @@ -267,7 +267,7 @@ packages: name: gql_exec url: "https://pub.dartlang.org" source: hosted - version: "0.2.5-alpha+1599667008843" + version: "0.2.5-alpha+1600790194941" gql_http_link: dependency: transitive description: @@ -281,7 +281,7 @@ packages: name: gql_link url: "https://pub.dartlang.org" source: hosted - version: "0.3.1-alpha+1599667008850" + version: "0.3.1-alpha+1600790194948" graphql: dependency: transitive description: @@ -337,14 +337,14 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.1.0" json_serializable: dependency: transitive description: name: json_serializable url: "https://pub.dartlang.org" source: hosted - version: "3.4.1" + version: "3.5.0" logging: dependency: transitive description: @@ -414,7 +414,7 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "1.6.16" + version: "1.6.18" path_provider_linux: dependency: transitive description: @@ -442,7 +442,7 @@ packages: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.3" + version: "0.0.4+1" pedantic: dependency: transitive description: @@ -517,7 +517,7 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "0.9.6" + version: "0.9.7+1" source_span: dependency: transitive description: diff --git a/pubspec.lock b/pubspec.lock index 00d2966..13aeed2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -154,7 +154,7 @@ packages: name: connectivity url: "https://pub.dartlang.org" source: hosted - version: "0.4.9+2" + version: "0.4.9+3" connectivity_for_web: dependency: transitive description: @@ -267,7 +267,7 @@ packages: name: gql url: "https://pub.dartlang.org" source: hosted - version: "0.12.4-alpha+1599667008836" + version: "0.12.4-alpha+1600790194928" gql_code_gen: dependency: transitive description: @@ -288,7 +288,7 @@ packages: name: gql_exec url: "https://pub.dartlang.org" source: hosted - version: "0.2.5-alpha+1599667008843" + version: "0.2.5-alpha+1600790194941" gql_http_link: dependency: transitive description: @@ -302,7 +302,7 @@ packages: name: gql_link url: "https://pub.dartlang.org" source: hosted - version: "0.3.1-alpha+1599667008850" + version: "0.3.1-alpha+1600790194948" graphql: dependency: transitive description: @@ -379,14 +379,14 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.1.0" json_serializable: dependency: "direct main" description: name: json_serializable url: "https://pub.dartlang.org" source: hosted - version: "3.4.1" + version: "3.5.0" logging: dependency: transitive description: @@ -449,7 +449,7 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "1.6.16" + version: "1.6.18" path_provider_linux: dependency: transitive description: @@ -477,7 +477,7 @@ packages: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.3" + version: "0.0.4+1" pedantic: dependency: transitive description: @@ -573,7 +573,7 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "0.9.6" + version: "0.9.7+1" source_span: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 4b32726..01a9889 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,13 +15,13 @@ dependencies: equatable: ^1.2.5 gql: ">=0.7.3 <1.0.0" # update according to DOCS https://pub.dev/packages/artemis/versions/6.12.3-beta.1#installation meta: ">=1.0.0 <2.0.0" # only if you have non nullable fields - path_provider: ^1.5.1 + path_provider: ^1.6.18 graphql_flutter: ^3.1.0 analyzer: ^0.39.2+1 - artemis: ^6.12.3-beta.1 # add beta because have a Exception: Two classes were generated with the same name # according to https://github.com/comigor/artemis/issues/194#issuecomment-670576452 # use the latest beta version + artemis: ^6.12.3-beta.1 json_annotation: ^3.0.1 http: ^0.12.0+4 From 0b90aa1ade90c42451403ac8ad0d215efcfbebff Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Sun, 27 Sep 2020 18:01:13 +0200 Subject: [PATCH 08/24] finshed todo in main --- .vscode/launch.json | 15 --- example/lib/api_keys.dart | 1 + example/lib/apis/auth_apis.dart | 8 ++ .../lib/{APIs.dart => apis/general_api.dart} | 0 example/lib/main.dart | 99 +++++++------------ example/lib/screens/address_screen.dart | 10 +- example/lib/screens/general_screen.dart | 14 +-- example/lib/screens/main_second.dart | 32 ------ example/lib/screens/product_screen.dart | 24 ++--- 9 files changed, 66 insertions(+), 137 deletions(-) delete mode 100644 .vscode/launch.json create mode 100644 example/lib/api_keys.dart rename example/lib/{APIs.dart => apis/general_api.dart} (100%) delete mode 100644 example/lib/screens/main_second.dart diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 7a9dfa0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "pwa-chrome", - "request": "launch", - "name": "Launch Chrome against localhost", - "url": "http://localhost:8080", - "webRoot": "${workspaceFolder}" - } - ] -} \ No newline at end of file diff --git a/example/lib/api_keys.dart b/example/lib/api_keys.dart new file mode 100644 index 0000000..e8d247b --- /dev/null +++ b/example/lib/api_keys.dart @@ -0,0 +1 @@ +const BASE_URL = "https://egfoods.moselaymdserver.com"; diff --git a/example/lib/apis/auth_apis.dart b/example/lib/apis/auth_apis.dart index 42c98ad..4b1a876 100644 --- a/example/lib/apis/auth_apis.dart +++ b/example/lib/apis/auth_apis.dart @@ -1,5 +1,13 @@ import 'package:mmd_ecommerce_fl_lib/mmd_ecommerce.dart'; +callLoginApi() async { + await AuthApiManager.loginApi("test@mail.com", "123456789", "123", + (SignIn$Mutation$AuthPayload authPayload) async { + MmdECommerceFlLib.submitTokeAndTokenType( + authPayload.accessToken, authPayload.tokenType); + }, (ApiErrorModel error) {}); +} + callRegisterApi() { AuthApiManager.registerApi("mmd10", "rovox4067sri@ka0525.com", "123456", (SignUp$Mutation$User register) {}, (ApiErrorModel error) {}); diff --git a/example/lib/APIs.dart b/example/lib/apis/general_api.dart similarity index 100% rename from example/lib/APIs.dart rename to example/lib/apis/general_api.dart diff --git a/example/lib/main.dart b/example/lib/main.dart index 3725baa..fc41f49 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -2,16 +2,13 @@ import 'package:flutter/material.dart'; import 'package:mmd_ecommerce_fl_lib/mmd_ecommerce.dart'; import 'package:mmd_ecommerce_fl_lib_example/screens/address_screen.dart'; import 'package:mmd_ecommerce_fl_lib_example/screens/general_screen.dart'; -import 'package:mmd_ecommerce_fl_lib_example/screens/main_second.dart'; +import 'api_keys.dart'; import 'apis/auth_apis.dart'; import 'apis/user_apis.dart'; import 'screens/product_screen.dart'; void main() { - // TODO enhance example by split all APIs that related to each other in one file - // TODO style all buttons that call the same APIs category with the same style - // TODO all APIs that in the same category will be in a separated screen. // TODO remove the base url from the main example. [May be not because the graphConfig file] runApp(MyApp()); } @@ -20,7 +17,7 @@ class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { - MmdECommerceFlLib.submitBaseUrl("https://egfoods.moselaymdserver.com"); + MmdECommerceFlLib.submitBaseUrl(BASE_URL); MmdECommerceFlLib.enableDebug(true); MmdECommerceFlLib.submitLanguage(Languages.arabic); return MaterialApp( @@ -47,7 +44,6 @@ class _MyHomePageState extends State { @override void initState() { - // Future.delayed(Duration(microseconds: 0)).then((value) => callApi()); super.initState(); } @@ -60,51 +56,26 @@ class _MyHomePageState extends State { body: Center(child: isLoading ? getLoadingView() : getNormalView())); } - // callApi() async { - // setState(() { - // isLoading = true; - // }); - // AuthApiManager.loginApi('test@mail.com', '123456789', "123", - // (SignIn$Mutation$AuthPayload auth) { - // setState(() { - // this.isLoading = false; - // this.auth = auth; - // }); - // }, () { - // this.isError = true; - // }); - // } - Widget getLoadingView() { return CircularProgressIndicator(); } Widget getNormalView() { - if (isError) { - return Text("Result Error"); - } else { - return Column( + return SingleChildScrollView( + child: Column( children: [ - Text("Result Success \n${auth?.accessToken}"), - RaisedButton( - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => MainSecond(auth.refreshToken)), - ); - }, - child: Text("Open Main Second"), - ), RaisedButton( - color: Colors.amber, + color: Colors.deepPurple, onPressed: () { Navigator.push( context, MaterialPageRoute(builder: (context) => AddressScreen()), ); }, - child: Text("Open Address Screen"), + child: Text( + "Open Address Screen", + style: TextStyle(color: Colors.white), + ), ), RaisedButton( color: Colors.blueAccent, @@ -114,7 +85,10 @@ class _MyHomePageState extends State { MaterialPageRoute(builder: (context) => GeneralScreen()), ); }, - child: Text("Open General Screen"), + child: Text( + "Open General Screen", + style: TextStyle(color: Colors.white), + ), ), RaisedButton( color: Colors.deepOrangeAccent, @@ -127,11 +101,14 @@ class _MyHomePageState extends State { child: Text("Open Product Screen"), ), RaisedButton( - color: Colors.amber, + color: Colors.green, onPressed: () { callLoginApi(); }, - child: Text("Test login"), + child: Text( + "Test login", + style: TextStyle(color: Colors.white), + ), ), Row( mainAxisAlignment: MainAxisAlignment.center, @@ -159,18 +136,6 @@ class _MyHomePageState extends State { ), ], ), - TextField( - controller: emailController, - decoration: InputDecoration(hintText: "email"), - ), - TextField( - controller: codeController, - decoration: InputDecoration(hintText: "code"), - ), - TextField( - controller: passwordController, - decoration: InputDecoration(hintText: "password"), - ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -223,16 +188,26 @@ class _MyHomePageState extends State { ], ) ], - ); - } + ), + ); } - callLoginApi() async { - await AuthApiManager.loginApi("test@mail.com", "123456789", "123", - (SignIn$Mutation$AuthPayload authPayload) async { - auth = authPayload; - MmdECommerceFlLib.submitTokeAndTokenType( - authPayload.accessToken, authPayload.tokenType); - }, (ApiErrorModel error) {}); + Column authField() { + return Column( + children: [ + TextField( + controller: emailController, + decoration: InputDecoration(hintText: "email"), + ), + TextField( + controller: codeController, + decoration: InputDecoration(hintText: "code"), + ), + TextField( + controller: passwordController, + decoration: InputDecoration(hintText: "password"), + ), + ], + ); } } diff --git a/example/lib/screens/address_screen.dart b/example/lib/screens/address_screen.dart index d7cf3cd..221e6df 100644 --- a/example/lib/screens/address_screen.dart +++ b/example/lib/screens/address_screen.dart @@ -29,7 +29,7 @@ class _AddressScreenState extends State { ), ), RaisedButton( - color: Colors.transparent, + color: Colors.deepPurple, onPressed: () async { await getAreaByIdAsset("2"); }, @@ -39,7 +39,7 @@ class _AddressScreenState extends State { ), ), RaisedButton( - color: Colors.blue, + color: Colors.deepPurple, onPressed: () async { await getAllAddress(); }, @@ -49,7 +49,7 @@ class _AddressScreenState extends State { ), ), RaisedButton( - color: Colors.green, + color: Colors.deepPurple, onPressed: () async { await createAddress(); }, @@ -59,7 +59,7 @@ class _AddressScreenState extends State { ), ), RaisedButton( - color: Colors.yellow, + color: Colors.deepPurple, onPressed: () async { await updateAddress(); }, @@ -69,7 +69,7 @@ class _AddressScreenState extends State { ), ), RaisedButton( - color: Colors.red, + color: Colors.deepPurple, onPressed: () async { await deleteAddress(); }, diff --git a/example/lib/screens/general_screen.dart b/example/lib/screens/general_screen.dart index 4095a78..a3dbe42 100644 --- a/example/lib/screens/general_screen.dart +++ b/example/lib/screens/general_screen.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:mmd_ecommerce_fl_lib_example/APIs.dart'; import 'package:mmd_ecommerce_fl_lib_example/apis/cart_api.dart'; +import 'package:mmd_ecommerce_fl_lib_example/apis/general_api.dart'; import 'package:mmd_ecommerce_fl_lib_example/apis/user_apis.dart'; class GeneralScreen extends StatefulWidget { @@ -21,7 +21,7 @@ class _GeneralScreenState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ RaisedButton( - color: Colors.blue, + color: Colors.blueAccent, onPressed: () async { await sliderApi(); }, @@ -31,7 +31,7 @@ class _GeneralScreenState extends State { ), ), RaisedButton( - color: Colors.blue, + color: Colors.blueAccent, onPressed: () async { await addToCard(); }, @@ -41,7 +41,7 @@ class _GeneralScreenState extends State { ), ), RaisedButton( - color: Colors.blueGrey, + color: Colors.blueAccent, onPressed: () async { await getCard(); }, @@ -51,7 +51,7 @@ class _GeneralScreenState extends State { ), ), RaisedButton( - color: Colors.blueGrey, + color: Colors.blueAccent, onPressed: () async { await getVoucherByCode(); }, @@ -61,7 +61,7 @@ class _GeneralScreenState extends State { ), ), RaisedButton( - color: Colors.deepPurpleAccent, + color: Colors.blueAccent, onPressed: () async { await shippingFeesApi(); }, @@ -71,7 +71,7 @@ class _GeneralScreenState extends State { ), ), RaisedButton( - color: Colors.deepPurpleAccent, + color: Colors.blueAccent, onPressed: () async { await getAllOrdersApi(); }, diff --git a/example/lib/screens/main_second.dart b/example/lib/screens/main_second.dart deleted file mode 100644 index 0182677..0000000 --- a/example/lib/screens/main_second.dart +++ /dev/null @@ -1,32 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:mmd_ecommerce_fl_lib_example/apis/user_apis.dart'; - -class MainSecond extends StatefulWidget { - final String refreshToken; - - MainSecond(this.refreshToken); - - @override - _MainSecondState createState() => _MainSecondState(); -} - -class _MainSecondState extends State { - @override - void initState() { - Future.delayed(Duration(microseconds: 0)) - .then((value) => callRefreshTokenApi(widget.refreshToken)); - super.initState(); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text("Main Second"), - ), - body: Center( - child: Text("Mina"), - ), - ); - } -} diff --git a/example/lib/screens/product_screen.dart b/example/lib/screens/product_screen.dart index f17d2f6..64ae602 100644 --- a/example/lib/screens/product_screen.dart +++ b/example/lib/screens/product_screen.dart @@ -20,83 +20,75 @@ class _ProductScreenState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ RaisedButton( - color: Colors.blue, + color: Colors.deepOrangeAccent, onPressed: () async { await categoriesApi(); }, child: Text( "Categories Api", - style: TextStyle(color: Colors.white), ), ), RaisedButton( - color: Colors.deepPurpleAccent, + color: Colors.deepOrangeAccent, onPressed: () async { await productByCategoryIdApi(); }, child: Text( "get product by category id Api", - style: TextStyle(color: Colors.white), ), ), RaisedButton( - color: Colors.deepPurpleAccent, + color: Colors.deepOrangeAccent, onPressed: () async { await productByNameApi(); }, child: Text( "get product by name Api", - style: TextStyle(color: Colors.white), ), ), RaisedButton( - color: Colors.deepPurpleAccent, + color: Colors.deepOrangeAccent, onPressed: () async { await productApi(); }, child: Text( "get product Api", - style: TextStyle(color: Colors.white), ), ), RaisedButton( - color: Colors.deepPurpleAccent, + color: Colors.deepOrangeAccent, onPressed: () async { await newProductApi(); }, child: Text( "get new product Api", - style: TextStyle(color: Colors.white), ), ), RaisedButton( - color: Colors.deepPurpleAccent, + color: Colors.deepOrangeAccent, onPressed: () async { await getProductDetailsApi(); }, child: Text( "get product details Api", - style: TextStyle(color: Colors.white), ), ), RaisedButton( - color: Colors.deepPurpleAccent, + color: Colors.deepOrangeAccent, onPressed: () async { await relatedProductByIdApi(); }, child: Text( "get related product Api", - style: TextStyle(color: Colors.white), ), ), RaisedButton( - color: Colors.deepPurpleAccent, + color: Colors.deepOrangeAccent, onPressed: () async { await getRatingsForProductApi(); }, child: Text( "get ratings Api", - style: TextStyle(color: Colors.white), ), ), ], From ef4f83386a89630fb8b83960fd6452e3494c8731 Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Sun, 27 Sep 2020 18:03:08 +0200 Subject: [PATCH 09/24] added api_keys.dart to .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index fbd4729..1965c93 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,8 @@ build/ # If you're building an application, you may want to check-in your pubspec.lock pubspec.lock +example/lib/api_keys.dart + # Directory created by dartdoc # If you don't generate documentation locally you can remove this line. doc/api/ From 2e53006b4fc5d47d5e54e57132a845b2d0d32839 Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Sun, 27 Sep 2020 18:12:21 +0200 Subject: [PATCH 10/24] remove example/lib/api_keys.dart from git --- example/lib/api_keys.dart | 1 - 1 file changed, 1 deletion(-) delete mode 100644 example/lib/api_keys.dart diff --git a/example/lib/api_keys.dart b/example/lib/api_keys.dart deleted file mode 100644 index e8d247b..0000000 --- a/example/lib/api_keys.dart +++ /dev/null @@ -1 +0,0 @@ -const BASE_URL = "https://egfoods.moselaymdserver.com"; From d3e8ebf52556bfb06c712baa49d1db27c23c3d49 Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Sun, 27 Sep 2020 18:16:21 +0200 Subject: [PATCH 11/24] untrack .idea pubspec.lock --- .idea/codeStyles/Project.xml | 134 ----- .idea/libraries/Dart_Packages.xml | 796 ---------------------------- .idea/libraries/Dart_SDK.xml | 29 - .idea/libraries/Flutter_Plugins.xml | 14 - .idea/mmd-ecommerce-fl-lib.iml | 18 - .idea/sonarIssues.xml | 149 ------ .idea/workspace.xml | 188 ------- example/pubspec.lock | 621 ---------------------- pubspec.lock | 698 ------------------------ 9 files changed, 2647 deletions(-) delete mode 100644 .idea/codeStyles/Project.xml delete mode 100644 .idea/libraries/Dart_Packages.xml delete mode 100644 .idea/libraries/Dart_SDK.xml delete mode 100644 .idea/libraries/Flutter_Plugins.xml delete mode 100644 .idea/mmd-ecommerce-fl-lib.iml delete mode 100644 .idea/sonarIssues.xml delete mode 100644 .idea/workspace.xml delete mode 100644 example/pubspec.lock delete mode 100644 pubspec.lock diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 0d15693..0000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - - - -
- - - - xmlns:android - - ^$ - - - -
-
- - - - xmlns:.* - - ^$ - - - BY_NAME - -
-
- - - - .*:id - - http://schemas.android.com/apk/res/android - - - -
-
- - - - .*:name - - http://schemas.android.com/apk/res/android - - - -
-
- - - - name - - ^$ - - - -
-
- - - - style - - ^$ - - - -
-
- - - - .* - - ^$ - - - BY_NAME - -
-
- - - - .* - - http://schemas.android.com/apk/res/android - - - ANDROID_ATTRIBUTE_ORDER - -
-
- - - - .* - - .* - - - BY_NAME - -
-
-
-
-
-
\ No newline at end of file diff --git a/.idea/libraries/Dart_Packages.xml b/.idea/libraries/Dart_Packages.xml deleted file mode 100644 index f651e09..0000000 --- a/.idea/libraries/Dart_Packages.xml +++ /dev/null @@ -1,796 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Dart_SDK.xml b/.idea/libraries/Dart_SDK.xml deleted file mode 100644 index 0ce420d..0000000 --- a/.idea/libraries/Dart_SDK.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Flutter_Plugins.xml b/.idea/libraries/Flutter_Plugins.xml deleted file mode 100644 index 3a9962c..0000000 --- a/.idea/libraries/Flutter_Plugins.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/mmd-ecommerce-fl-lib.iml b/.idea/mmd-ecommerce-fl-lib.iml deleted file mode 100644 index 97ae688..0000000 --- a/.idea/mmd-ecommerce-fl-lib.iml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/sonarIssues.xml b/.idea/sonarIssues.xml deleted file mode 100644 index b9815ba..0000000 --- a/.idea/sonarIssues.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 3ed6a79..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1597074615866 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - file://$PROJECT_DIR$/lib/apis/general_api_manager.dart - 22 - - - file://$PROJECT_DIR$/example/lib/screens/main_second.dart - 32 - - - file://$PROJECT_DIR$/lib/apis/auth_api_manager.dart - 44 - - - file://$PROJECT_DIR$/lib/apis/user_api_manager.dart - 25 - - - file://$PROJECT_DIR$/lib/apis/user_api_manager.dart - 30 - - - - - \ No newline at end of file diff --git a/example/pubspec.lock b/example/pubspec.lock deleted file mode 100644 index 4abef36..0000000 --- a/example/pubspec.lock +++ /dev/null @@ -1,621 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - url: "https://pub.dartlang.org" - source: hosted - version: "7.0.0" - analyzer: - dependency: transitive - description: - name: analyzer - url: "https://pub.dartlang.org" - source: hosted - version: "0.39.17" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.0" - artemis: - dependency: "direct dev" - description: - name: artemis - url: "https://pub.dartlang.org" - source: hosted - version: "6.12.3-beta.1" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.5.0-nullsafety" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0-nullsafety" - build: - dependency: transitive - description: - name: build - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.0" - build_config: - dependency: transitive - description: - name: build_config - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.2" - built_collection: - dependency: transitive - description: - name: built_collection - url: "https://pub.dartlang.org" - source: hosted - version: "4.3.2" - built_value: - dependency: transitive - description: - name: built_value - url: "https://pub.dartlang.org" - source: hosted - version: "7.1.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety.2" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0-nullsafety" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety" - code_builder: - dependency: transitive - description: - name: code_builder - url: "https://pub.dartlang.org" - source: hosted - version: "3.4.1" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0-nullsafety.2" - connectivity: - dependency: transitive - description: - name: connectivity - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.9+3" - connectivity_for_web: - dependency: transitive - description: - name: connectivity_for_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.1+2" - connectivity_macos: - dependency: transitive - description: - name: connectivity_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0+5" - connectivity_platform_interface: - dependency: transitive - description: - name: connectivity_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.6" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.5" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.16.2" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3" - dart_style: - dependency: transitive - description: - name: dart_style - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.6" - equatable: - dependency: transitive - description: - name: equatable - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.5" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety" - ffi: - dependency: transitive - description: - name: ffi - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "5.2.1" - fixnum: - dependency: transitive - description: - name: fixnum - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.11" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - glob: - dependency: transitive - description: - name: glob - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - gql: - dependency: transitive - description: - name: gql - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.4-alpha+1600790194928" - gql_code_gen: - dependency: transitive - description: - name: gql_code_gen - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.5" - gql_dedupe_link: - dependency: transitive - description: - name: gql_dedupe_link - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.10" - gql_exec: - dependency: transitive - description: - name: gql_exec - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.5-alpha+1600790194941" - gql_http_link: - dependency: transitive - description: - name: gql_http_link - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.9" - gql_link: - dependency: transitive - description: - name: gql_link - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.1-alpha+1600790194948" - graphql: - dependency: transitive - description: - name: graphql - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" - graphql_flutter: - dependency: transitive - description: - name: graphql_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" - html: - dependency: transitive - description: - name: html - url: "https://pub.dartlang.org" - source: hosted - version: "0.14.0+3" - http: - dependency: transitive - description: - name: http - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.2" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.4" - intl: - dependency: transitive - description: - name: intl - url: "https://pub.dartlang.org" - source: hosted - version: "0.16.1" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.2" - json_annotation: - dependency: transitive - description: - name: json_annotation - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" - json_serializable: - dependency: transitive - description: - name: json_serializable - url: "https://pub.dartlang.org" - source: hosted - version: "3.5.0" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "0.11.4" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.10-nullsafety" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0-nullsafety.2" - mime: - dependency: transitive - description: - name: mime - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7" - mmd_ecommerce_fl_lib: - dependency: "direct main" - description: - path: ".." - relative: true - source: path - version: "0.0.9" - node_interop: - dependency: transitive - description: - name: node_interop - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - node_io: - dependency: transitive - description: - name: node_io - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - package_config: - dependency: transitive - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.3" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0-nullsafety" - path_provider: - dependency: transitive - description: - name: path_provider - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.18" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+2" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4+4" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4+1" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.2" - platform: - dependency: transitive - description: - name: platform - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.1" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.13" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.4" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.5" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.3" - recase: - dependency: transitive - description: - name: recase - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0" - rxdart: - dependency: transitive - description: - name: rxdart - url: "https://pub.dartlang.org" - source: hosted - version: "0.24.1" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_gen: - dependency: transitive - description: - name: source_gen - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7+1" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0-nullsafety" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0-nullsafety" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0-nullsafety" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0-nullsafety" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.19-nullsafety" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0-nullsafety.2" - uuid_enhanced: - dependency: transitive - description: - name: uuid_enhanced - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.2" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0-nullsafety.2" - watcher: - dependency: transitive - description: - name: watcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7+15" - websocket: - dependency: transitive - description: - name: websocket - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.5" - win32: - dependency: transitive - description: - name: win32 - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.3" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.1" -sdks: - dart: ">=2.10.0-0.0.dev <2.10.0" - flutter: ">=1.20.0 <2.0.0" diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index 13aeed2..0000000 --- a/pubspec.lock +++ /dev/null @@ -1,698 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - url: "https://pub.dartlang.org" - source: hosted - version: "7.0.0" - analyzer: - dependency: "direct main" - description: - name: analyzer - url: "https://pub.dartlang.org" - source: hosted - version: "0.39.17" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.0" - artemis: - dependency: "direct main" - description: - name: artemis - url: "https://pub.dartlang.org" - source: hosted - version: "6.12.3-beta.1" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.5.0-nullsafety" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0-nullsafety" - build: - dependency: transitive - description: - name: build - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - build_config: - dependency: transitive - description: - name: build_config - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.2" - build_daemon: - dependency: transitive - description: - name: build_daemon - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.4" - build_resolvers: - dependency: "direct dev" - description: - name: build_resolvers - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.11" - build_runner: - dependency: "direct dev" - description: - name: build_runner - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.2" - build_runner_core: - dependency: transitive - description: - name: build_runner_core - url: "https://pub.dartlang.org" - source: hosted - version: "6.0.1" - built_collection: - dependency: transitive - description: - name: built_collection - url: "https://pub.dartlang.org" - source: hosted - version: "4.3.2" - built_value: - dependency: transitive - description: - name: built_value - url: "https://pub.dartlang.org" - source: hosted - version: "7.1.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety.2" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0-nullsafety" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety" - code_builder: - dependency: transitive - description: - name: code_builder - url: "https://pub.dartlang.org" - source: hosted - version: "3.4.1" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0-nullsafety.2" - connectivity: - dependency: transitive - description: - name: connectivity - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.9+3" - connectivity_for_web: - dependency: transitive - description: - name: connectivity_for_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.1+2" - connectivity_macos: - dependency: transitive - description: - name: connectivity_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0+5" - connectivity_platform_interface: - dependency: transitive - description: - name: connectivity_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.6" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.5" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.16.2" - dart_style: - dependency: transitive - description: - name: dart_style - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.6" - equatable: - dependency: "direct main" - description: - name: equatable - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.5" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety" - ffi: - dependency: transitive - description: - name: ffi - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "5.2.1" - fixnum: - dependency: transitive - description: - name: fixnum - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.11" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - glob: - dependency: transitive - description: - name: glob - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - gql: - dependency: "direct main" - description: - name: gql - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.4-alpha+1600790194928" - gql_code_gen: - dependency: transitive - description: - name: gql_code_gen - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.5" - gql_dedupe_link: - dependency: transitive - description: - name: gql_dedupe_link - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.10" - gql_exec: - dependency: transitive - description: - name: gql_exec - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.5-alpha+1600790194941" - gql_http_link: - dependency: transitive - description: - name: gql_http_link - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.9" - gql_link: - dependency: transitive - description: - name: gql_link - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.1-alpha+1600790194948" - graphql: - dependency: transitive - description: - name: graphql - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" - graphql_flutter: - dependency: "direct main" - description: - name: graphql_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" - graphs: - dependency: transitive - description: - name: graphs - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - html: - dependency: transitive - description: - name: html - url: "https://pub.dartlang.org" - source: hosted - version: "0.14.0+3" - http: - dependency: "direct main" - description: - name: http - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.2" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.4" - intl: - dependency: transitive - description: - name: intl - url: "https://pub.dartlang.org" - source: hosted - version: "0.16.1" - io: - dependency: transitive - description: - name: io - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.4" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.2" - json_annotation: - dependency: "direct main" - description: - name: json_annotation - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" - json_serializable: - dependency: "direct main" - description: - name: json_serializable - url: "https://pub.dartlang.org" - source: hosted - version: "3.5.0" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "0.11.4" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.10-nullsafety" - meta: - dependency: "direct main" - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0-nullsafety.2" - mime: - dependency: transitive - description: - name: mime - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7" - node_interop: - dependency: transitive - description: - name: node_interop - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - node_io: - dependency: transitive - description: - name: node_io - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - package_config: - dependency: transitive - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.3" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0-nullsafety" - path_provider: - dependency: "direct main" - description: - name: path_provider - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.18" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+2" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4+4" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4+1" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.2" - platform: - dependency: transitive - description: - name: platform - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.1" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - pool: - dependency: transitive - description: - name: pool - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.0" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.13" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.4" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.5" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.3" - recase: - dependency: transitive - description: - name: recase - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0" - rxdart: - dependency: transitive - description: - name: rxdart - url: "https://pub.dartlang.org" - source: hosted - version: "0.24.1" - shelf: - dependency: transitive - description: - name: shelf - url: "https://pub.dartlang.org" - source: hosted - version: "0.7.9" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.3" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_gen: - dependency: transitive - description: - name: source_gen - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7+1" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0-nullsafety" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0-nullsafety" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0-nullsafety" - stream_transform: - dependency: transitive - description: - name: stream_transform - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0-nullsafety" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.19-nullsafety" - timing: - dependency: transitive - description: - name: timing - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.1+2" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0-nullsafety.2" - uuid_enhanced: - dependency: transitive - description: - name: uuid_enhanced - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.2" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0-nullsafety.2" - watcher: - dependency: transitive - description: - name: watcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7+15" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - websocket: - dependency: transitive - description: - name: websocket - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.5" - win32: - dependency: transitive - description: - name: win32 - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.3" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.1" -sdks: - dart: ">=2.10.0-0.0.dev <2.10.0" - flutter: ">=1.20.0 <2.0.0" From 9bd99bba41c2b768278f1735886b0b4b869e7446 Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Sun, 27 Sep 2020 19:53:49 +0200 Subject: [PATCH 12/24] added common model --- lib/apis/address_api_manager.dart | 7 +- lib/apis/auth_api_manager.dart | 6 +- lib/apis/user_api_manager.dart | 7 +- lib/common_models/common_models.dart | 147 ++++++++++----------------- 4 files changed, 68 insertions(+), 99 deletions(-) diff --git a/lib/apis/address_api_manager.dart b/lib/apis/address_api_manager.dart index ade9888..738477b 100644 --- a/lib/apis/address_api_manager.dart +++ b/lib/apis/address_api_manager.dart @@ -93,7 +93,8 @@ class AddressApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(GetAllAddress$Query.fromJson(result.data).addresses); + success( + AddressesModel(GetAllAddress$Query.fromJson(result.data).addresses)); } } @@ -103,7 +104,7 @@ class AddressApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(Cities$Query.fromJson(result.data).cities); + success(CitiesModel(Cities$Query.fromJson(result.data).cities)); } } @@ -115,7 +116,7 @@ class AddressApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(AreaByID$Query.fromJson(result.data).areas); + success(AreasModel(AreaByID$Query.fromJson(result.data).areas)); } } } diff --git a/lib/apis/auth_api_manager.dart b/lib/apis/auth_api_manager.dart index 69c3a2b..ef52693 100644 --- a/lib/apis/auth_api_manager.dart +++ b/lib/apis/auth_api_manager.dart @@ -15,7 +15,8 @@ class AuthApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(SignIn$Mutation.fromJson(result.data).login); + success( + AuthPayloadLoginModel(SignIn$Mutation.fromJson(result.data).login)); } } @@ -28,7 +29,8 @@ class AuthApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(SignUp$Mutation.fromJson(result.data).register); + success( + UserRegisterModel(SignUp$Mutation.fromJson(result.data).register)); } } diff --git a/lib/apis/user_api_manager.dart b/lib/apis/user_api_manager.dart index 27c9273..950ef21 100644 --- a/lib/apis/user_api_manager.dart +++ b/lib/apis/user_api_manager.dart @@ -15,7 +15,8 @@ class UserApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(RefreshToken$Mutation.fromJson(result.data).refreshToken); + success(AuthPayloadRefreshTokenModel( + RefreshToken$Mutation.fromJson(result.data).refreshToken)); } } @@ -39,7 +40,7 @@ class UserApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(Profile$Query.fromJson(result.data).profile); + success(UserProfileModel(Profile$Query.fromJson(result.data).profile)); } } @@ -51,7 +52,7 @@ class UserApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(Orders$Query.fromJson(result.data).orders); + success(OrdersModel(Orders$Query.fromJson(result.data).orders)); } } } diff --git a/lib/common_models/common_models.dart b/lib/common_models/common_models.dart index 2b19e8e..a13823d 100644 --- a/lib/common_models/common_models.dart +++ b/lib/common_models/common_models.dart @@ -1,91 +1,56 @@ -// import 'package:mmd_ecommerce_fl_lib/generatedql/auth/graphql_api.dart' as A; -// import 'package:mmd_ecommerce_fl_lib/generatedql/user/graphql_api.dart' as U; -// import 'package:mmd_ecommerce_fl_lib/generatedql/products/graphql_api.dart' -// as P; -// import 'package:mmd_ecommerce_fl_lib/generatedql/cart/graphql_api.dart' as C; -// import 'package:mmd_ecommerce_fl_lib/generatedql/categories/graphql_api.dart' -// as CT; -// import 'package:mmd_ecommerce_fl_lib/generatedql/ratings/graphql_api.dart' as R; -// import 'package:mmd_ecommerce_fl_lib/generatedql/related_product/graphql_api.dart' -// as RELATED; -// import 'package:mmd_ecommerce_fl_lib/generatedql/order_products/graphql_api.dart' -// as O; - -// /// this class to solve conflicts between the same model names of the graphql api -// class UserMyProfile { -// final U.User user; - -// UserMyProfile(this.user); -// } - -// class UserRegister { -// final A.User user; - -// UserRegister(this.user); -// } - -// class AuthPayloadLogin { -// final A.AuthPayload authPayload; - -// AuthPayloadLogin(this.authPayload); -// } - -// class AuthPayloadRefreshToken { -// final U.AuthPayload authPayload; - -// AuthPayloadRefreshToken(this.authPayload); -// } - -// class MediaCard { -// final C.Media media; - -// MediaCard(this.media); -// } - -// class MediaProduct { -// final P.Media media; - -// MediaProduct(this.media); -// } - -// class MediaCategory { -// final CT.Media media; - -// MediaCategory(this.media); -// } - -// class CategoryModel { -// final CT.Category category; - -// CategoryModel(this.category); -// } - -// class RatingPaginatorModel { -// final R.RatingPaginator ratingPaginator; - -// RatingPaginatorModel(this.ratingPaginator); -// } - -// class ProductPaginatorModel { -// final P.ProductPaginator productPaginator; - -// ProductPaginatorModel(this.productPaginator); -// } - -// class ProductDetailsModel { -// final P.Product productDetails; - -// ProductDetailsModel(this.productDetails); -// } - -// class RelatedProductsModel { -// final List products; - -// RelatedProductsModel(this.products); -// } - -// class NewProductsModel { -// final O.ProductPaginator productPaginator; - -// NewProductsModel(this.productPaginator); -// } +import 'package:mmd_ecommerce_fl_lib/generatedql/auth/graphql_api.graphql.dart' + as A; +import 'package:mmd_ecommerce_fl_lib/generatedql/user/graphql_api.graphql.dart' + as U; +import 'package:mmd_ecommerce_fl_lib/generatedql/address/graphql_api.graphql.dart' + as ADD; +import 'package:mmd_ecommerce_fl_lib/generatedql/address_asset/graphql_api.graphql.dart' + as ASS; +import 'package:mmd_ecommerce_fl_lib/generatedql/orders/graphql_api.graphql.dart' + as O; + +/// this class to solve conflicts between the same model names of the graphql api +class UserProfileModel { + final U.Profile$Query$User user; + + UserProfileModel(this.user); +} + +class UserRegisterModel { + final A.SignUp$Mutation$User user; + + UserRegisterModel(this.user); +} + +class AuthPayloadLoginModel { + final A.SignIn$Mutation$AuthPayload authPayload; + + AuthPayloadLoginModel(this.authPayload); +} + +class AuthPayloadRefreshTokenModel { + final U.RefreshToken$Mutation$AuthPayload authPayload; + + AuthPayloadRefreshTokenModel(this.authPayload); +} + +class AddressesModel { + final ADD.GetAllAddress$Query$UserAddressPaginator addressPaginator; + + AddressesModel(this.addressPaginator); +} + +class CitiesModel { + final List cities; + CitiesModel(this.cities); +} + +class AreasModel { + final List areas; + AreasModel(this.areas); +} + +class OrdersModel { + final O.Orders$Query$OrderPaginator orders; + OrdersModel(this.orders); +} From f974b26c9f1ee2f2a6db88e87b1a37ae0391728c Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Sun, 27 Sep 2020 20:06:11 +0200 Subject: [PATCH 13/24] added user fragmeent --- lib/generatedql/auth/graphql_api.graphql.dart | 74 ++++++++++--------- lib/generatedql/user/graphql_api.graphql.dart | 74 ++++++++++--------- lib/graphql/auth/sign_up.graphql | 5 +- lib/graphql/fragments.graphql | 6 ++ lib/graphql/user/profile.graphql | 5 +- lib/mmd_ecommerce.dart | 2 +- 6 files changed, 91 insertions(+), 75 deletions(-) diff --git a/lib/generatedql/auth/graphql_api.graphql.dart b/lib/generatedql/auth/graphql_api.graphql.dart index e36afe1..3e69e68 100644 --- a/lib/generatedql/auth/graphql_api.graphql.dart +++ b/lib/generatedql/auth/graphql_api.graphql.dart @@ -7,21 +7,20 @@ import 'package:equatable/equatable.dart'; import 'package:gql/ast.dart'; part 'graphql_api.graphql.g.dart'; +mixin UserMixin { + String id; + String name; + String email; + String mobile; +} + @JsonSerializable(explicitToJson: true) -class SignUp$Mutation$User with EquatableMixin { +class SignUp$Mutation$User with EquatableMixin, UserMixin { SignUp$Mutation$User(); factory SignUp$Mutation$User.fromJson(Map json) => _$SignUp$Mutation$UserFromJson(json); - String id; - - String name; - - String email; - - String mobile; - @override List get props => [id, name, email, mobile]; Map toJson() => _$SignUp$Mutation$UserToJson(this); @@ -197,31 +196,40 @@ class SignUpMutation extends GraphQLQuery { ], directives: [], selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'email'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'mobile'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) + FragmentSpreadNode( + name: NameNode(value: 'User'), directives: []) ])) + ])), + FragmentDefinitionNode( + name: NameNode(value: 'User'), + typeCondition: TypeConditionNode( + on: NamedTypeNode(name: NameNode(value: 'User'), isNonNull: false)), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'email'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'mobile'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) ])) ]); diff --git a/lib/generatedql/user/graphql_api.graphql.dart b/lib/generatedql/user/graphql_api.graphql.dart index 960f0fb..037e3a6 100644 --- a/lib/generatedql/user/graphql_api.graphql.dart +++ b/lib/generatedql/user/graphql_api.graphql.dart @@ -7,6 +7,13 @@ import 'package:equatable/equatable.dart'; import 'package:gql/ast.dart'; part 'graphql_api.graphql.g.dart'; +mixin UserMixin { + String id; + String name; + String email; + String mobile; +} + @JsonSerializable(explicitToJson: true) class RefreshToken$Mutation$AuthPayload with EquatableMixin { RefreshToken$Mutation$AuthPayload(); @@ -48,20 +55,12 @@ class RefreshToken$Mutation with EquatableMixin { } @JsonSerializable(explicitToJson: true) -class Profile$Query$User with EquatableMixin { +class Profile$Query$User with EquatableMixin, UserMixin { Profile$Query$User(); factory Profile$Query$User.fromJson(Map json) => _$Profile$Query$UserFromJson(json); - String id; - - String name; - - String email; - - String mobile; - @override List get props => [id, name, email, mobile]; Map toJson() => _$Profile$Query$UserToJson(this); @@ -198,31 +197,40 @@ class ProfileQuery extends GraphQLQuery { arguments: [], directives: [], selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'email'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'mobile'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) + FragmentSpreadNode( + name: NameNode(value: 'User'), directives: []) ])) + ])), + FragmentDefinitionNode( + name: NameNode(value: 'User'), + typeCondition: TypeConditionNode( + on: NamedTypeNode(name: NameNode(value: 'User'), isNonNull: false)), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'email'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'mobile'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) ])) ]); diff --git a/lib/graphql/auth/sign_up.graphql b/lib/graphql/auth/sign_up.graphql index 3b2b7ee..5ae9ced 100644 --- a/lib/graphql/auth/sign_up.graphql +++ b/lib/graphql/auth/sign_up.graphql @@ -1,8 +1,5 @@ mutation SignUp($name: String!, $email: String!, $password: String!) { register(input: { name: $name, email: $email, password: $password ,password_confirmation:$password }) { - id - name - email - mobile + ...User } } diff --git a/lib/graphql/fragments.graphql b/lib/graphql/fragments.graphql index a617910..0ad9f4d 100644 --- a/lib/graphql/fragments.graphql +++ b/lib/graphql/fragments.graphql @@ -31,4 +31,10 @@ fragment Product on Product{ id } } +} +fragment User on User{ + id + name + email + mobile } \ No newline at end of file diff --git a/lib/graphql/user/profile.graphql b/lib/graphql/user/profile.graphql index bf87d55..71855ff 100644 --- a/lib/graphql/user/profile.graphql +++ b/lib/graphql/user/profile.graphql @@ -1,8 +1,5 @@ query Profile{ profile{ - id - name - email - mobile + ...User } } \ No newline at end of file diff --git a/lib/mmd_ecommerce.dart b/lib/mmd_ecommerce.dart index e515951..d4737e5 100644 --- a/lib/mmd_ecommerce.dart +++ b/lib/mmd_ecommerce.dart @@ -41,7 +41,7 @@ export './generatedql/categories/graphql_api.dart'; export './generatedql/orders/graphql_api.dart' hide PagingMixin; export './generatedql/auth/graphql_api.dart'; export './generatedql/general/graphql_api.dart'; -export './generatedql/user/graphql_api.dart'; +export './generatedql/user/graphql_api.dart' hide UserMixin; export './generatedql/address_asset/graphql_api.dart'; export './generatedql/address/graphql_api.dart' hide PagingMixin; export './mmd_ecommerce.dart'; From ffa90e84192fcefe781af6f70566ccd582cc4c07 Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Sun, 27 Sep 2020 20:42:37 +0200 Subject: [PATCH 14/24] update pubspec.yaml --- pubspec.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 01a9889..364c68b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,13 +11,10 @@ environment: dependencies: flutter: sdk: flutter - json_serializable: ^3.2.3 equatable: ^1.2.5 gql: ">=0.7.3 <1.0.0" # update according to DOCS https://pub.dev/packages/artemis/versions/6.12.3-beta.1#installation meta: ">=1.0.0 <2.0.0" # only if you have non nullable fields - path_provider: ^1.6.18 graphql_flutter: ^3.1.0 - analyzer: ^0.39.2+1 # add beta because have a Exception: Two classes were generated with the same name # according to https://github.com/comigor/artemis/issues/194#issuecomment-670576452 # use the latest beta version @@ -29,4 +26,5 @@ dev_dependencies: flutter_test: sdk: flutter build_runner: ^1.10.1 - build_resolvers: ^1.3.10 + build_resolvers: ^1.4.1 + json_serializable: ^3.0.0 From 8d74f900214839eebffe83228d2f4008d6e640f6 Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Sun, 27 Sep 2020 20:47:29 +0200 Subject: [PATCH 15/24] added AuthPayload fragmeent --- lib/generatedql/auth/graphql_api.graphql.dart | 82 ++++++++++--------- lib/generatedql/user/graphql_api.graphql.dart | 82 ++++++++++--------- lib/graphql/auth/sign_in.graphql | 5 +- lib/graphql/fragments.graphql | 6 ++ lib/graphql/user/refresh_token.graphql | 5 +- 5 files changed, 98 insertions(+), 82 deletions(-) diff --git a/lib/generatedql/auth/graphql_api.graphql.dart b/lib/generatedql/auth/graphql_api.graphql.dart index 3e69e68..32fce28 100644 --- a/lib/generatedql/auth/graphql_api.graphql.dart +++ b/lib/generatedql/auth/graphql_api.graphql.dart @@ -13,6 +13,16 @@ mixin UserMixin { String email; String mobile; } +mixin AuthPayloadMixin { + @JsonKey(name: 'access_token') + String accessToken; + @JsonKey(name: 'refresh_token') + String refreshToken; + @JsonKey(name: 'expires_in') + int expiresIn; + @JsonKey(name: 'token_type') + String tokenType; +} @JsonSerializable(explicitToJson: true) class SignUp$Mutation$User with EquatableMixin, UserMixin { @@ -83,24 +93,12 @@ class ForgetPassword$Mutation with EquatableMixin { } @JsonSerializable(explicitToJson: true) -class SignIn$Mutation$AuthPayload with EquatableMixin { +class SignIn$Mutation$AuthPayload with EquatableMixin, AuthPayloadMixin { SignIn$Mutation$AuthPayload(); factory SignIn$Mutation$AuthPayload.fromJson(Map json) => _$SignIn$Mutation$AuthPayloadFromJson(json); - @JsonKey(name: 'access_token') - String accessToken; - - @JsonKey(name: 'refresh_token') - String refreshToken; - - @JsonKey(name: 'expires_in') - int expiresIn; - - @JsonKey(name: 'token_type') - String tokenType; - @override List get props => [accessToken, refreshToken, expiresIn, tokenType]; Map toJson() => _$SignIn$Mutation$AuthPayloadToJson(this); @@ -501,31 +499,41 @@ class SignInMutation extends GraphQLQuery { ], directives: [], selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'access_token'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'refresh_token'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'expires_in'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'token_type'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) + FragmentSpreadNode( + name: NameNode(value: 'AuthPayload'), directives: []) ])) + ])), + FragmentDefinitionNode( + name: NameNode(value: 'AuthPayload'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'AuthPayload'), isNonNull: false)), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'access_token'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'refresh_token'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'expires_in'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'token_type'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) ])) ]); diff --git a/lib/generatedql/user/graphql_api.graphql.dart b/lib/generatedql/user/graphql_api.graphql.dart index 037e3a6..cdfdaa0 100644 --- a/lib/generatedql/user/graphql_api.graphql.dart +++ b/lib/generatedql/user/graphql_api.graphql.dart @@ -7,6 +7,16 @@ import 'package:equatable/equatable.dart'; import 'package:gql/ast.dart'; part 'graphql_api.graphql.g.dart'; +mixin AuthPayloadMixin { + @JsonKey(name: 'access_token') + String accessToken; + @JsonKey(name: 'refresh_token') + String refreshToken; + @JsonKey(name: 'expires_in') + int expiresIn; + @JsonKey(name: 'token_type') + String tokenType; +} mixin UserMixin { String id; String name; @@ -15,25 +25,13 @@ mixin UserMixin { } @JsonSerializable(explicitToJson: true) -class RefreshToken$Mutation$AuthPayload with EquatableMixin { +class RefreshToken$Mutation$AuthPayload with EquatableMixin, AuthPayloadMixin { RefreshToken$Mutation$AuthPayload(); factory RefreshToken$Mutation$AuthPayload.fromJson( Map json) => _$RefreshToken$Mutation$AuthPayloadFromJson(json); - @JsonKey(name: 'access_token') - String accessToken; - - @JsonKey(name: 'refresh_token') - String refreshToken; - - @JsonKey(name: 'expires_in') - int expiresIn; - - @JsonKey(name: 'token_type') - String tokenType; - @override List get props => [accessToken, refreshToken, expiresIn, tokenType]; Map toJson() => @@ -139,31 +137,41 @@ class RefreshTokenMutation ], directives: [], selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'access_token'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'refresh_token'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'expires_in'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'token_type'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) + FragmentSpreadNode( + name: NameNode(value: 'AuthPayload'), directives: []) ])) + ])), + FragmentDefinitionNode( + name: NameNode(value: 'AuthPayload'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'AuthPayload'), isNonNull: false)), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'access_token'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'refresh_token'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'expires_in'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'token_type'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) ])) ]); diff --git a/lib/graphql/auth/sign_in.graphql b/lib/graphql/auth/sign_in.graphql index bfa8a4f..d5ebb71 100644 --- a/lib/graphql/auth/sign_in.graphql +++ b/lib/graphql/auth/sign_in.graphql @@ -1,8 +1,5 @@ mutation SignIn($email: String!, $password: String!,$deviceToken:String!){ login(input: {email: $email, password: $password, device_token:$deviceToken }){ - access_token - refresh_token - expires_in - token_type + ...AuthPayload } } \ No newline at end of file diff --git a/lib/graphql/fragments.graphql b/lib/graphql/fragments.graphql index 0ad9f4d..d12d5d9 100644 --- a/lib/graphql/fragments.graphql +++ b/lib/graphql/fragments.graphql @@ -37,4 +37,10 @@ fragment User on User{ name email mobile +} +fragment AuthPayload on AuthPayload{ + access_token + refresh_token + expires_in + token_type } \ No newline at end of file diff --git a/lib/graphql/user/refresh_token.graphql b/lib/graphql/user/refresh_token.graphql index cf8b6f0..22a5315 100644 --- a/lib/graphql/user/refresh_token.graphql +++ b/lib/graphql/user/refresh_token.graphql @@ -1,8 +1,5 @@ mutation RefreshToken($token: String!){ refreshToken(token: $token){ - access_token - refresh_token - expires_in - token_type + ...AuthPayload } } \ No newline at end of file From 8c90daf56e24583ddeb1e29d5388f5cf3ad382d2 Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Sun, 27 Sep 2020 21:14:21 +0200 Subject: [PATCH 16/24] addel all model needed --- lib/apis/cart_api_manager.dart | 3 +- lib/apis/general_api_manager.dart | 5 +- lib/apis/product_api_manager.dart | 21 ++++--- lib/common_models/common_models.dart | 83 ++++++++++++++++++++++------ lib/mmd_ecommerce.dart | 2 +- 5 files changed, 85 insertions(+), 29 deletions(-) diff --git a/lib/apis/cart_api_manager.dart b/lib/apis/cart_api_manager.dart index a2a58a6..3a6598f 100644 --- a/lib/apis/cart_api_manager.dart +++ b/lib/apis/cart_api_manager.dart @@ -1,6 +1,7 @@ import 'package:graphql_flutter/graphql_flutter.dart'; import 'package:mmd_ecommerce_fl_lib/apis/base/base_api_manager.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/cart/graphql_api.dart'; +import '../mmd_ecommerce.dart'; import 'error/api_error_helper.dart'; class CartApiManager extends BaseApiManager { @@ -24,7 +25,7 @@ class CartApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(GetCart$Query.fromJson(result.data).cart); + success(CartModel(GetCart$Query.fromJson(result.data).cart)); } } diff --git a/lib/apis/general_api_manager.dart b/lib/apis/general_api_manager.dart index 3d458eb..0ebbb74 100644 --- a/lib/apis/general_api_manager.dart +++ b/lib/apis/general_api_manager.dart @@ -3,6 +3,7 @@ import 'package:mmd_ecommerce_fl_lib/apis/base/base_api_manager.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/categories/graphql_api.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/general/graphql_api.dart'; +import '../mmd_ecommerce.dart'; import 'error/api_error_helper.dart'; class GeneralApiManager extends BaseApiManager { @@ -22,7 +23,7 @@ class GeneralApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(Sliders$Query.fromJson(result.data).sliders); + success(SliderModel(Sliders$Query.fromJson(result.data).sliders)); } } @@ -32,7 +33,7 @@ class GeneralApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(Categories$Query.fromJson(result.data).categories); + success(CategoryModel(Categories$Query.fromJson(result.data).categories)); } } } diff --git a/lib/apis/product_api_manager.dart b/lib/apis/product_api_manager.dart index d3ffaae..7e78631 100644 --- a/lib/apis/product_api_manager.dart +++ b/lib/apis/product_api_manager.dart @@ -15,7 +15,8 @@ class ProductApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(Products$Query.fromJson(result.data).products); + success(ProductsPaginatorModel( + Products$Query.fromJson(result.data).products)); } } @@ -29,7 +30,8 @@ class ProductApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(Products$Query.fromJson(result.data).products); + success(ProductsPaginatorModel( + Products$Query.fromJson(result.data).products)); } } @@ -42,7 +44,8 @@ class ProductApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(Products$Query.fromJson(result.data).products.data.first); + success(ProductModel( + Products$Query.fromJson(result.data).products.data.first)); } } @@ -55,7 +58,8 @@ class ProductApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(Products$Query.fromJson(result.data).products); + success(ProductsPaginatorModel( + Products$Query.fromJson(result.data).products)); } } @@ -67,7 +71,8 @@ class ProductApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(RelatedProducts$Query.fromJson(result.data).relatedProducts); + success(RelatedProductsModel( + RelatedProducts$Query.fromJson(result.data).relatedProducts)); } } @@ -81,7 +86,8 @@ class ProductApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(Ratings$Query.fromJson(result.data).ratings); + success( + RatingPaginatorModel(Ratings$Query.fromJson(result.data).ratings)); } } @@ -103,7 +109,8 @@ class ProductApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(OrderProducts$Query.fromJson(result.data).products); + success(OrderProductsModel( + OrderProducts$Query.fromJson(result.data).products)); } } } diff --git a/lib/common_models/common_models.dart b/lib/common_models/common_models.dart index a13823d..4012a37 100644 --- a/lib/common_models/common_models.dart +++ b/lib/common_models/common_models.dart @@ -1,56 +1,103 @@ -import 'package:mmd_ecommerce_fl_lib/generatedql/auth/graphql_api.graphql.dart' - as A; -import 'package:mmd_ecommerce_fl_lib/generatedql/user/graphql_api.graphql.dart' - as U; -import 'package:mmd_ecommerce_fl_lib/generatedql/address/graphql_api.graphql.dart' - as ADD; -import 'package:mmd_ecommerce_fl_lib/generatedql/address_asset/graphql_api.graphql.dart' - as ASS; -import 'package:mmd_ecommerce_fl_lib/generatedql/orders/graphql_api.graphql.dart' - as O; +import 'package:mmd_ecommerce_fl_lib/generatedql/auth/graphql_api.graphql.dart'; +import 'package:mmd_ecommerce_fl_lib/generatedql/cart/graphql_api.graphql.dart'; +import 'package:mmd_ecommerce_fl_lib/generatedql/categories/graphql_api.dart'; +import 'package:mmd_ecommerce_fl_lib/generatedql/general/graphql_api.dart'; +import 'package:mmd_ecommerce_fl_lib/generatedql/order_products/graphql_api.dart'; +import 'package:mmd_ecommerce_fl_lib/generatedql/products/graphql_api.dart'; +import 'package:mmd_ecommerce_fl_lib/generatedql/ratings/graphql_api.graphql.dart'; +import 'package:mmd_ecommerce_fl_lib/generatedql/related_product/graphql_api.dart'; +import 'package:mmd_ecommerce_fl_lib/generatedql/user/graphql_api.graphql.dart'; +import 'package:mmd_ecommerce_fl_lib/generatedql/address/graphql_api.graphql.dart'; +import 'package:mmd_ecommerce_fl_lib/generatedql/address_asset/graphql_api.graphql.dart'; +import 'package:mmd_ecommerce_fl_lib/generatedql/orders/graphql_api.graphql.dart'; /// this class to solve conflicts between the same model names of the graphql api class UserProfileModel { - final U.Profile$Query$User user; + final Profile$Query$User user; UserProfileModel(this.user); } class UserRegisterModel { - final A.SignUp$Mutation$User user; + final SignUp$Mutation$User user; UserRegisterModel(this.user); } class AuthPayloadLoginModel { - final A.SignIn$Mutation$AuthPayload authPayload; + final SignIn$Mutation$AuthPayload authPayload; AuthPayloadLoginModel(this.authPayload); } class AuthPayloadRefreshTokenModel { - final U.RefreshToken$Mutation$AuthPayload authPayload; + final RefreshToken$Mutation$AuthPayload authPayload; AuthPayloadRefreshTokenModel(this.authPayload); } class AddressesModel { - final ADD.GetAllAddress$Query$UserAddressPaginator addressPaginator; + final GetAllAddress$Query$UserAddressPaginator addressPaginator; AddressesModel(this.addressPaginator); } class CitiesModel { - final List cities; + final List cities; CitiesModel(this.cities); } class AreasModel { - final List areas; + final List areas; AreasModel(this.areas); } class OrdersModel { - final O.Orders$Query$OrderPaginator orders; + final Orders$Query$OrderPaginator orders; OrdersModel(this.orders); } + +class CartModel { + final GetCart$Query$Cart cart; + CartModel(this.cart); +} + +class VoucherModel { + final GetVoucherByCode$Query$Voucher voucherByCode; + VoucherModel(this.voucherByCode); +} + +class SliderModel { + final List slider; + SliderModel(this.slider); +} + +class CategoryModel { + final List category; + CategoryModel(this.category); +} + +class ProductsPaginatorModel { + final Products$Query$ProductPaginator productsPaginator; + ProductsPaginatorModel(this.productsPaginator); +} + +class ProductModel { + final Products$Query$ProductPaginator$Product productDetails; + ProductModel(this.productDetails); +} + +class RelatedProductsModel { + final List relatedProducts; + RelatedProductsModel(this.relatedProducts); +} + +class RatingPaginatorModel { + final Ratings$Query$RatingPaginator ratingPaginator; + RatingPaginatorModel(this.ratingPaginator); +} + +class OrderProductsModel { + final OrderProducts$Query$ProductPaginator orderProducts; + OrderProductsModel(this.orderProducts); +} diff --git a/lib/mmd_ecommerce.dart b/lib/mmd_ecommerce.dart index d4737e5..a3f9a3a 100644 --- a/lib/mmd_ecommerce.dart +++ b/lib/mmd_ecommerce.dart @@ -41,7 +41,7 @@ export './generatedql/categories/graphql_api.dart'; export './generatedql/orders/graphql_api.dart' hide PagingMixin; export './generatedql/auth/graphql_api.dart'; export './generatedql/general/graphql_api.dart'; -export './generatedql/user/graphql_api.dart' hide UserMixin; +export './generatedql/user/graphql_api.dart' hide UserMixin, AuthPayloadMixin; export './generatedql/address_asset/graphql_api.dart'; export './generatedql/address/graphql_api.dart' hide PagingMixin; export './mmd_ecommerce.dart'; From df1bc18cf9763ee659602c04affe2abf45e2c144 Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Sun, 27 Sep 2020 21:21:09 +0200 Subject: [PATCH 17/24] added order_product & related_product graphql query to product folder --- build.yaml | 6 - example/lib/apis/product_apis.dart | 4 +- lib/apis/product_api_manager.dart | 2 - lib/common_models/common_models.dart | 4 +- .../order_products/graphql_api.dart | 2 - .../order_products/graphql_api.graphql.dart | 528 -------------- .../order_products/graphql_api.graphql.g.dart | 240 ------- .../products/graphql_api.graphql.dart | 679 +++++++++++++++++- .../products/graphql_api.graphql.g.dart | 254 ++++++- .../related_product/graphql_api.dart | 2 - .../related_product/graphql_api.graphql.dart | 293 -------- .../graphql_api.graphql.g.dart | 134 ---- .../order_product.graphql | 0 .../related_product.graphql | 0 lib/mmd_ecommerce.dart | 16 +- 15 files changed, 894 insertions(+), 1270 deletions(-) delete mode 100644 lib/generatedql/order_products/graphql_api.dart delete mode 100644 lib/generatedql/order_products/graphql_api.graphql.dart delete mode 100644 lib/generatedql/order_products/graphql_api.graphql.g.dart delete mode 100644 lib/generatedql/related_product/graphql_api.dart delete mode 100644 lib/generatedql/related_product/graphql_api.graphql.dart delete mode 100644 lib/generatedql/related_product/graphql_api.graphql.g.dart rename lib/graphql/{order_products => products}/order_product.graphql (100%) rename lib/graphql/{related_product => products}/related_product.graphql (100%) diff --git a/build.yaml b/build.yaml index a349210..ffa49c2 100644 --- a/build.yaml +++ b/build.yaml @@ -31,15 +31,9 @@ targets: - schema: general.schema.graphql queries_glob: lib/graphql/categories/*.graphql output: lib/generatedql/categories/graphql_api.dart - - schema: general.schema.graphql - queries_glob: lib/graphql/related_product/*.graphql - output: lib/generatedql/related_product/graphql_api.dart - schema: general.schema.graphql queries_glob: lib/graphql/ratings/*.graphql output: lib/generatedql/ratings/graphql_api.dart - - schema: general.schema.graphql - queries_glob: lib/graphql/order_products/*.graphql - output: lib/generatedql/order_products/graphql_api.dart - schema: general.schema.graphql queries_glob: lib/graphql/orders/*.graphql output: lib/generatedql/orders/graphql_api.dart diff --git a/example/lib/apis/product_apis.dart b/example/lib/apis/product_apis.dart index e7294e8..8163c79 100644 --- a/example/lib/apis/product_apis.dart +++ b/example/lib/apis/product_apis.dart @@ -38,8 +38,8 @@ productByNameApi() async { } relatedProductByIdApi() async { - await ProductApiManager.relatedProductsByIdApi("1", - (List items) {}, (ApiErrorModel error) {}); + await ProductApiManager.relatedProductsByIdApi( + "1", (RelatedProductsModel items) {}, (ApiErrorModel error) {}); } getRatingsForProductApi() async { diff --git a/lib/apis/product_api_manager.dart b/lib/apis/product_api_manager.dart index 7e78631..40f09bc 100644 --- a/lib/apis/product_api_manager.dart +++ b/lib/apis/product_api_manager.dart @@ -1,7 +1,5 @@ import 'package:graphql_flutter/graphql_flutter.dart'; import 'package:mmd_ecommerce_fl_lib/apis/base/base_api_manager.dart'; -import 'package:mmd_ecommerce_fl_lib/generatedql/order_products/graphql_api.dart'; -import 'package:mmd_ecommerce_fl_lib/generatedql/related_product/graphql_api.dart'; import 'package:mmd_ecommerce_fl_lib/mmd_ecommerce.dart'; import '../mmd_ecommerce.dart'; diff --git a/lib/common_models/common_models.dart b/lib/common_models/common_models.dart index 4012a37..d12ba28 100644 --- a/lib/common_models/common_models.dart +++ b/lib/common_models/common_models.dart @@ -2,10 +2,10 @@ import 'package:mmd_ecommerce_fl_lib/generatedql/auth/graphql_api.graphql.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/cart/graphql_api.graphql.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/categories/graphql_api.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/general/graphql_api.dart'; -import 'package:mmd_ecommerce_fl_lib/generatedql/order_products/graphql_api.dart'; +// import 'package:mmd_ecommerce_fl_lib/generatedql/order_products/graphql_api.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/products/graphql_api.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/ratings/graphql_api.graphql.dart'; -import 'package:mmd_ecommerce_fl_lib/generatedql/related_product/graphql_api.dart'; +// import 'package:mmd_ecommerce_fl_lib/generatedql/related_product/graphql_api.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/user/graphql_api.graphql.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/address/graphql_api.graphql.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/address_asset/graphql_api.graphql.dart'; diff --git a/lib/generatedql/order_products/graphql_api.dart b/lib/generatedql/order_products/graphql_api.dart deleted file mode 100644 index 196c5cd..0000000 --- a/lib/generatedql/order_products/graphql_api.dart +++ /dev/null @@ -1,2 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND -export 'graphql_api.graphql.dart'; diff --git a/lib/generatedql/order_products/graphql_api.graphql.dart b/lib/generatedql/order_products/graphql_api.graphql.dart deleted file mode 100644 index 87fd654..0000000 --- a/lib/generatedql/order_products/graphql_api.graphql.dart +++ /dev/null @@ -1,528 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -import 'package:meta/meta.dart'; -import 'package:artemis/artemis.dart'; -import 'package:json_annotation/json_annotation.dart'; -import 'package:equatable/equatable.dart'; -import 'package:gql/ast.dart'; -part 'graphql_api.graphql.g.dart'; - -mixin PagingMixin { - int count; - int currentPage; - int firstItem; - int lastItem; - bool hasMorePages; - int lastPage; - int perPage; - int total; -} -mixin ProductMixin { - String id; - String averageRating; - String price; - bool available; - ProductMixin$ProductData details; -} - -@JsonSerializable(explicitToJson: true) -class OrderProducts$Query$ProductPaginator$PaginatorInfo - with EquatableMixin, PagingMixin { - OrderProducts$Query$ProductPaginator$PaginatorInfo(); - - factory OrderProducts$Query$ProductPaginator$PaginatorInfo.fromJson( - Map json) => - _$OrderProducts$Query$ProductPaginator$PaginatorInfoFromJson(json); - - @override - List get props => [ - count, - currentPage, - firstItem, - lastItem, - hasMorePages, - lastPage, - perPage, - total - ]; - Map toJson() => - _$OrderProducts$Query$ProductPaginator$PaginatorInfoToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class OrderProducts$Query$ProductPaginator$Product - with EquatableMixin, ProductMixin { - OrderProducts$Query$ProductPaginator$Product(); - - factory OrderProducts$Query$ProductPaginator$Product.fromJson( - Map json) => - _$OrderProducts$Query$ProductPaginator$ProductFromJson(json); - - @override - List get props => [id, averageRating, price, available, details]; - Map toJson() => - _$OrderProducts$Query$ProductPaginator$ProductToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class OrderProducts$Query$ProductPaginator with EquatableMixin { - OrderProducts$Query$ProductPaginator(); - - factory OrderProducts$Query$ProductPaginator.fromJson( - Map json) => - _$OrderProducts$Query$ProductPaginatorFromJson(json); - - OrderProducts$Query$ProductPaginator$PaginatorInfo paginatorInfo; - - List data; - - @override - List get props => [paginatorInfo, data]; - Map toJson() => - _$OrderProducts$Query$ProductPaginatorToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class OrderProducts$Query with EquatableMixin { - OrderProducts$Query(); - - factory OrderProducts$Query.fromJson(Map json) => - _$OrderProducts$QueryFromJson(json); - - OrderProducts$Query$ProductPaginator products; - - @override - List get props => [products]; - Map toJson() => _$OrderProducts$QueryToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class ProductMixin$ProductData$Media with EquatableMixin { - ProductMixin$ProductData$Media(); - - factory ProductMixin$ProductData$Media.fromJson(Map json) => - _$ProductMixin$ProductData$MediaFromJson(json); - - String url; - - @override - List get props => [url]; - Map toJson() => _$ProductMixin$ProductData$MediaToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class ProductMixin$ProductData$Unit with EquatableMixin { - ProductMixin$ProductData$Unit(); - - factory ProductMixin$ProductData$Unit.fromJson(Map json) => - _$ProductMixin$ProductData$UnitFromJson(json); - - String id; - - String name; - - @override - List get props => [id, name]; - Map toJson() => _$ProductMixin$ProductData$UnitToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class ProductMixin$ProductData$Category with EquatableMixin { - ProductMixin$ProductData$Category(); - - factory ProductMixin$ProductData$Category.fromJson( - Map json) => - _$ProductMixin$ProductData$CategoryFromJson(json); - - String id; - - @override - List get props => [id]; - Map toJson() => - _$ProductMixin$ProductData$CategoryToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class ProductMixin$ProductData with EquatableMixin { - ProductMixin$ProductData(); - - factory ProductMixin$ProductData.fromJson(Map json) => - _$ProductMixin$ProductDataFromJson(json); - - String name; - - String sku; - - String description; - - ProductMixin$ProductData$Media cover; - - ProductMixin$ProductData$Unit unit; - - List media; - - ProductMixin$ProductData$Category category; - - @override - List get props => - [name, sku, description, cover, unit, media, category]; - Map toJson() => _$ProductMixin$ProductDataToJson(this); -} - -enum ProductsOrderByColumn { - @JsonValue('ID') - id, - @JsonValue('NAME') - name, - @JsonValue('ARTEMIS_UNKNOWN') - artemisUnknown, -} -enum SortOrder { - @JsonValue('ASC') - asc, - @JsonValue('DESC') - desc, - @JsonValue('ARTEMIS_UNKNOWN') - artemisUnknown, -} - -@JsonSerializable(explicitToJson: true) -class OrderProductsArguments extends JsonSerializable with EquatableMixin { - OrderProductsArguments( - {@required this.first, - @required this.page, - this.productsId, - this.catId, - this.name, - @required this.fieldOfOrder, - @required this.orderType}); - - @override - factory OrderProductsArguments.fromJson(Map json) => - _$OrderProductsArgumentsFromJson(json); - - final int first; - - final int page; - - final String productsId; - - final List catId; - - final String name; - - @JsonKey(unknownEnumValue: ProductsOrderByColumn.artemisUnknown) - final ProductsOrderByColumn fieldOfOrder; - - @JsonKey(unknownEnumValue: SortOrder.artemisUnknown) - final SortOrder orderType; - - @override - List get props => - [first, page, productsId, catId, name, fieldOfOrder, orderType]; - @override - Map toJson() => _$OrderProductsArgumentsToJson(this); -} - -class OrderProductsQuery - extends GraphQLQuery { - OrderProductsQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'OrderProducts'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'first')), - type: - NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'page')), - type: - NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'productsId')), - type: - NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: false), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'catId')), - type: ListTypeNode( - type: NamedTypeNode( - name: NameNode(value: 'ID'), isNonNull: false), - isNonNull: false), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'name')), - type: NamedTypeNode( - name: NameNode(value: 'String'), isNonNull: false), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'fieldOfOrder')), - type: NamedTypeNode( - name: NameNode(value: 'ProductsOrderByColumn'), - isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []), - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'orderType')), - type: NamedTypeNode( - name: NameNode(value: 'SortOrder'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'products'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'first'), - value: VariableNode(name: NameNode(value: 'first'))), - ArgumentNode( - name: NameNode(value: 'page'), - value: VariableNode(name: NameNode(value: 'page'))), - ArgumentNode( - name: NameNode(value: 'filter'), - value: ObjectValueNode(fields: [ - ObjectFieldNode( - name: NameNode(value: 'name'), - value: VariableNode(name: NameNode(value: 'name'))), - ObjectFieldNode( - name: NameNode(value: 'id'), - value: VariableNode( - name: NameNode(value: 'productsId'))), - ObjectFieldNode( - name: NameNode(value: 'category'), - value: VariableNode(name: NameNode(value: 'catId'))) - ])), - ArgumentNode( - name: NameNode(value: 'orderBy'), - value: ObjectValueNode(fields: [ - ObjectFieldNode( - name: NameNode(value: 'field'), - value: VariableNode( - name: NameNode(value: 'fieldOfOrder'))), - ObjectFieldNode( - name: NameNode(value: 'order'), - value: - VariableNode(name: NameNode(value: 'orderType'))) - ])) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'paginatorInfo'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FragmentSpreadNode( - name: NameNode(value: 'Paging'), directives: []) - ])), - FieldNode( - name: NameNode(value: 'data'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FragmentSpreadNode( - name: NameNode(value: 'Product'), directives: []) - ])) - ])) - ])), - FragmentDefinitionNode( - name: NameNode(value: 'Paging'), - typeCondition: TypeConditionNode( - on: NamedTypeNode( - name: NameNode(value: 'PaginatorInfo'), isNonNull: false)), - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'count'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'currentPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'firstItem'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'lastItem'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'hasMorePages'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'lastPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'perPage'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'total'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FragmentDefinitionNode( - name: NameNode(value: 'Product'), - typeCondition: TypeConditionNode( - on: NamedTypeNode( - name: NameNode(value: 'Product'), isNonNull: false)), - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'averageRating'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'price'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'available'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'details'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'sku'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'description'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'cover'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'url'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'unit'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'media'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'url'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'category'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ])) - ]); - - @override - final String operationName = 'OrderProducts'; - - @override - final OrderProductsArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - OrderProducts$Query parse(Map json) => - OrderProducts$Query.fromJson(json); -} diff --git a/lib/generatedql/order_products/graphql_api.graphql.g.dart b/lib/generatedql/order_products/graphql_api.graphql.g.dart deleted file mode 100644 index 6d6819e..0000000 --- a/lib/generatedql/order_products/graphql_api.graphql.g.dart +++ /dev/null @@ -1,240 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'graphql_api.graphql.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -OrderProducts$Query$ProductPaginator$PaginatorInfo - _$OrderProducts$Query$ProductPaginator$PaginatorInfoFromJson( - Map json) { - return OrderProducts$Query$ProductPaginator$PaginatorInfo() - ..count = json['count'] as int - ..currentPage = json['currentPage'] as int - ..firstItem = json['firstItem'] as int - ..lastItem = json['lastItem'] as int - ..hasMorePages = json['hasMorePages'] as bool - ..lastPage = json['lastPage'] as int - ..perPage = json['perPage'] as int - ..total = json['total'] as int; -} - -Map _$OrderProducts$Query$ProductPaginator$PaginatorInfoToJson( - OrderProducts$Query$ProductPaginator$PaginatorInfo instance) => - { - 'count': instance.count, - 'currentPage': instance.currentPage, - 'firstItem': instance.firstItem, - 'lastItem': instance.lastItem, - 'hasMorePages': instance.hasMorePages, - 'lastPage': instance.lastPage, - 'perPage': instance.perPage, - 'total': instance.total, - }; - -OrderProducts$Query$ProductPaginator$Product - _$OrderProducts$Query$ProductPaginator$ProductFromJson( - Map json) { - return OrderProducts$Query$ProductPaginator$Product() - ..id = json['id'] as String - ..averageRating = json['averageRating'] as String - ..price = json['price'] as String - ..available = json['available'] as bool - ..details = json['details'] == null - ? null - : ProductMixin$ProductData.fromJson( - json['details'] as Map); -} - -Map _$OrderProducts$Query$ProductPaginator$ProductToJson( - OrderProducts$Query$ProductPaginator$Product instance) => - { - 'id': instance.id, - 'averageRating': instance.averageRating, - 'price': instance.price, - 'available': instance.available, - 'details': instance.details?.toJson(), - }; - -OrderProducts$Query$ProductPaginator - _$OrderProducts$Query$ProductPaginatorFromJson(Map json) { - return OrderProducts$Query$ProductPaginator() - ..paginatorInfo = json['paginatorInfo'] == null - ? null - : OrderProducts$Query$ProductPaginator$PaginatorInfo.fromJson( - json['paginatorInfo'] as Map) - ..data = (json['data'] as List) - ?.map((e) => e == null - ? null - : OrderProducts$Query$ProductPaginator$Product.fromJson( - e as Map)) - ?.toList(); -} - -Map _$OrderProducts$Query$ProductPaginatorToJson( - OrderProducts$Query$ProductPaginator instance) => - { - 'paginatorInfo': instance.paginatorInfo?.toJson(), - 'data': instance.data?.map((e) => e?.toJson())?.toList(), - }; - -OrderProducts$Query _$OrderProducts$QueryFromJson(Map json) { - return OrderProducts$Query() - ..products = json['products'] == null - ? null - : OrderProducts$Query$ProductPaginator.fromJson( - json['products'] as Map); -} - -Map _$OrderProducts$QueryToJson( - OrderProducts$Query instance) => - { - 'products': instance.products?.toJson(), - }; - -ProductMixin$ProductData$Media _$ProductMixin$ProductData$MediaFromJson( - Map json) { - return ProductMixin$ProductData$Media()..url = json['url'] as String; -} - -Map _$ProductMixin$ProductData$MediaToJson( - ProductMixin$ProductData$Media instance) => - { - 'url': instance.url, - }; - -ProductMixin$ProductData$Unit _$ProductMixin$ProductData$UnitFromJson( - Map json) { - return ProductMixin$ProductData$Unit() - ..id = json['id'] as String - ..name = json['name'] as String; -} - -Map _$ProductMixin$ProductData$UnitToJson( - ProductMixin$ProductData$Unit instance) => - { - 'id': instance.id, - 'name': instance.name, - }; - -ProductMixin$ProductData$Category _$ProductMixin$ProductData$CategoryFromJson( - Map json) { - return ProductMixin$ProductData$Category()..id = json['id'] as String; -} - -Map _$ProductMixin$ProductData$CategoryToJson( - ProductMixin$ProductData$Category instance) => - { - 'id': instance.id, - }; - -ProductMixin$ProductData _$ProductMixin$ProductDataFromJson( - Map json) { - return ProductMixin$ProductData() - ..name = json['name'] as String - ..sku = json['sku'] as String - ..description = json['description'] as String - ..cover = json['cover'] == null - ? null - : ProductMixin$ProductData$Media.fromJson( - json['cover'] as Map) - ..unit = json['unit'] == null - ? null - : ProductMixin$ProductData$Unit.fromJson( - json['unit'] as Map) - ..media = (json['media'] as List) - ?.map((e) => e == null - ? null - : ProductMixin$ProductData$Media.fromJson( - e as Map)) - ?.toList() - ..category = json['category'] == null - ? null - : ProductMixin$ProductData$Category.fromJson( - json['category'] as Map); -} - -Map _$ProductMixin$ProductDataToJson( - ProductMixin$ProductData instance) => - { - 'name': instance.name, - 'sku': instance.sku, - 'description': instance.description, - 'cover': instance.cover?.toJson(), - 'unit': instance.unit?.toJson(), - 'media': instance.media?.map((e) => e?.toJson())?.toList(), - 'category': instance.category?.toJson(), - }; - -OrderProductsArguments _$OrderProductsArgumentsFromJson( - Map json) { - return OrderProductsArguments( - first: json['first'] as int, - page: json['page'] as int, - productsId: json['productsId'] as String, - catId: (json['catId'] as List)?.map((e) => e as String)?.toList(), - name: json['name'] as String, - fieldOfOrder: _$enumDecodeNullable( - _$ProductsOrderByColumnEnumMap, json['fieldOfOrder'], - unknownValue: ProductsOrderByColumn.artemisUnknown), - orderType: _$enumDecodeNullable(_$SortOrderEnumMap, json['orderType'], - unknownValue: SortOrder.artemisUnknown), - ); -} - -Map _$OrderProductsArgumentsToJson( - OrderProductsArguments instance) => - { - 'first': instance.first, - 'page': instance.page, - 'productsId': instance.productsId, - 'catId': instance.catId, - 'name': instance.name, - 'fieldOfOrder': _$ProductsOrderByColumnEnumMap[instance.fieldOfOrder], - 'orderType': _$SortOrderEnumMap[instance.orderType], - }; - -T _$enumDecode( - Map enumValues, - dynamic source, { - T unknownValue, -}) { - if (source == null) { - throw ArgumentError('A value must be provided. Supported values: ' - '${enumValues.values.join(', ')}'); - } - - final value = enumValues.entries - .singleWhere((e) => e.value == source, orElse: () => null) - ?.key; - - if (value == null && unknownValue == null) { - throw ArgumentError('`$source` is not one of the supported values: ' - '${enumValues.values.join(', ')}'); - } - return value ?? unknownValue; -} - -T _$enumDecodeNullable( - Map enumValues, - dynamic source, { - T unknownValue, -}) { - if (source == null) { - return null; - } - return _$enumDecode(enumValues, source, unknownValue: unknownValue); -} - -const _$ProductsOrderByColumnEnumMap = { - ProductsOrderByColumn.id: 'ID', - ProductsOrderByColumn.name: 'NAME', - ProductsOrderByColumn.artemisUnknown: 'ARTEMIS_UNKNOWN', -}; - -const _$SortOrderEnumMap = { - SortOrder.asc: 'ASC', - SortOrder.desc: 'DESC', - SortOrder.artemisUnknown: 'ARTEMIS_UNKNOWN', -}; diff --git a/lib/generatedql/products/graphql_api.graphql.dart b/lib/generatedql/products/graphql_api.graphql.dart index fb676d4..f8a60aa 100644 --- a/lib/generatedql/products/graphql_api.graphql.dart +++ b/lib/generatedql/products/graphql_api.graphql.dart @@ -26,13 +26,13 @@ mixin ProductMixin { } @JsonSerializable(explicitToJson: true) -class Products$Query$ProductPaginator$PaginatorInfo +class OrderProducts$Query$ProductPaginator$PaginatorInfo with EquatableMixin, PagingMixin { - Products$Query$ProductPaginator$PaginatorInfo(); + OrderProducts$Query$ProductPaginator$PaginatorInfo(); - factory Products$Query$ProductPaginator$PaginatorInfo.fromJson( + factory OrderProducts$Query$ProductPaginator$PaginatorInfo.fromJson( Map json) => - _$Products$Query$ProductPaginator$PaginatorInfoFromJson(json); + _$OrderProducts$Query$ProductPaginator$PaginatorInfoFromJson(json); @override List get props => [ @@ -46,53 +46,54 @@ class Products$Query$ProductPaginator$PaginatorInfo total ]; Map toJson() => - _$Products$Query$ProductPaginator$PaginatorInfoToJson(this); + _$OrderProducts$Query$ProductPaginator$PaginatorInfoToJson(this); } @JsonSerializable(explicitToJson: true) -class Products$Query$ProductPaginator$Product +class OrderProducts$Query$ProductPaginator$Product with EquatableMixin, ProductMixin { - Products$Query$ProductPaginator$Product(); + OrderProducts$Query$ProductPaginator$Product(); - factory Products$Query$ProductPaginator$Product.fromJson( + factory OrderProducts$Query$ProductPaginator$Product.fromJson( Map json) => - _$Products$Query$ProductPaginator$ProductFromJson(json); + _$OrderProducts$Query$ProductPaginator$ProductFromJson(json); @override List get props => [id, averageRating, price, available, details]; Map toJson() => - _$Products$Query$ProductPaginator$ProductToJson(this); + _$OrderProducts$Query$ProductPaginator$ProductToJson(this); } @JsonSerializable(explicitToJson: true) -class Products$Query$ProductPaginator with EquatableMixin { - Products$Query$ProductPaginator(); +class OrderProducts$Query$ProductPaginator with EquatableMixin { + OrderProducts$Query$ProductPaginator(); - factory Products$Query$ProductPaginator.fromJson(Map json) => - _$Products$Query$ProductPaginatorFromJson(json); + factory OrderProducts$Query$ProductPaginator.fromJson( + Map json) => + _$OrderProducts$Query$ProductPaginatorFromJson(json); - Products$Query$ProductPaginator$PaginatorInfo paginatorInfo; + OrderProducts$Query$ProductPaginator$PaginatorInfo paginatorInfo; - List data; + List data; @override List get props => [paginatorInfo, data]; Map toJson() => - _$Products$Query$ProductPaginatorToJson(this); + _$OrderProducts$Query$ProductPaginatorToJson(this); } @JsonSerializable(explicitToJson: true) -class Products$Query with EquatableMixin { - Products$Query(); +class OrderProducts$Query with EquatableMixin { + OrderProducts$Query(); - factory Products$Query.fromJson(Map json) => - _$Products$QueryFromJson(json); + factory OrderProducts$Query.fromJson(Map json) => + _$OrderProducts$QueryFromJson(json); - Products$Query$ProductPaginator products; + OrderProducts$Query$ProductPaginator products; @override List get props => [products]; - Map toJson() => _$Products$QueryToJson(this); + Map toJson() => _$OrderProducts$QueryToJson(this); } @JsonSerializable(explicitToJson: true) @@ -168,6 +169,638 @@ class ProductMixin$ProductData with EquatableMixin { Map toJson() => _$ProductMixin$ProductDataToJson(this); } +@JsonSerializable(explicitToJson: true) +class RelatedProducts$Query$Product with EquatableMixin, ProductMixin { + RelatedProducts$Query$Product(); + + factory RelatedProducts$Query$Product.fromJson(Map json) => + _$RelatedProducts$Query$ProductFromJson(json); + + @override + List get props => [id, averageRating, price, available, details]; + Map toJson() => _$RelatedProducts$Query$ProductToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class RelatedProducts$Query with EquatableMixin { + RelatedProducts$Query(); + + factory RelatedProducts$Query.fromJson(Map json) => + _$RelatedProducts$QueryFromJson(json); + + List relatedProducts; + + @override + List get props => [relatedProducts]; + Map toJson() => _$RelatedProducts$QueryToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Products$Query$ProductPaginator$PaginatorInfo + with EquatableMixin, PagingMixin { + Products$Query$ProductPaginator$PaginatorInfo(); + + factory Products$Query$ProductPaginator$PaginatorInfo.fromJson( + Map json) => + _$Products$Query$ProductPaginator$PaginatorInfoFromJson(json); + + @override + List get props => [ + count, + currentPage, + firstItem, + lastItem, + hasMorePages, + lastPage, + perPage, + total + ]; + Map toJson() => + _$Products$Query$ProductPaginator$PaginatorInfoToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Products$Query$ProductPaginator$Product + with EquatableMixin, ProductMixin { + Products$Query$ProductPaginator$Product(); + + factory Products$Query$ProductPaginator$Product.fromJson( + Map json) => + _$Products$Query$ProductPaginator$ProductFromJson(json); + + @override + List get props => [id, averageRating, price, available, details]; + Map toJson() => + _$Products$Query$ProductPaginator$ProductToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Products$Query$ProductPaginator with EquatableMixin { + Products$Query$ProductPaginator(); + + factory Products$Query$ProductPaginator.fromJson(Map json) => + _$Products$Query$ProductPaginatorFromJson(json); + + Products$Query$ProductPaginator$PaginatorInfo paginatorInfo; + + List data; + + @override + List get props => [paginatorInfo, data]; + Map toJson() => + _$Products$Query$ProductPaginatorToJson(this); +} + +@JsonSerializable(explicitToJson: true) +class Products$Query with EquatableMixin { + Products$Query(); + + factory Products$Query.fromJson(Map json) => + _$Products$QueryFromJson(json); + + Products$Query$ProductPaginator products; + + @override + List get props => [products]; + Map toJson() => _$Products$QueryToJson(this); +} + +enum ProductsOrderByColumn { + @JsonValue('ID') + id, + @JsonValue('NAME') + name, + @JsonValue('ARTEMIS_UNKNOWN') + artemisUnknown, +} +enum SortOrder { + @JsonValue('ASC') + asc, + @JsonValue('DESC') + desc, + @JsonValue('ARTEMIS_UNKNOWN') + artemisUnknown, +} + +@JsonSerializable(explicitToJson: true) +class OrderProductsArguments extends JsonSerializable with EquatableMixin { + OrderProductsArguments( + {@required this.first, + @required this.page, + this.productsId, + this.catId, + this.name, + @required this.fieldOfOrder, + @required this.orderType}); + + @override + factory OrderProductsArguments.fromJson(Map json) => + _$OrderProductsArgumentsFromJson(json); + + final int first; + + final int page; + + final String productsId; + + final List catId; + + final String name; + + @JsonKey(unknownEnumValue: ProductsOrderByColumn.artemisUnknown) + final ProductsOrderByColumn fieldOfOrder; + + @JsonKey(unknownEnumValue: SortOrder.artemisUnknown) + final SortOrder orderType; + + @override + List get props => + [first, page, productsId, catId, name, fieldOfOrder, orderType]; + @override + Map toJson() => _$OrderProductsArgumentsToJson(this); +} + +class OrderProductsQuery + extends GraphQLQuery { + OrderProductsQuery({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'OrderProducts'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'first')), + type: + NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'page')), + type: + NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'productsId')), + type: + NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: false), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'catId')), + type: ListTypeNode( + type: NamedTypeNode( + name: NameNode(value: 'ID'), isNonNull: false), + isNonNull: false), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'name')), + type: NamedTypeNode( + name: NameNode(value: 'String'), isNonNull: false), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'fieldOfOrder')), + type: NamedTypeNode( + name: NameNode(value: 'ProductsOrderByColumn'), + isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'orderType')), + type: NamedTypeNode( + name: NameNode(value: 'SortOrder'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'products'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'first'), + value: VariableNode(name: NameNode(value: 'first'))), + ArgumentNode( + name: NameNode(value: 'page'), + value: VariableNode(name: NameNode(value: 'page'))), + ArgumentNode( + name: NameNode(value: 'filter'), + value: ObjectValueNode(fields: [ + ObjectFieldNode( + name: NameNode(value: 'name'), + value: VariableNode(name: NameNode(value: 'name'))), + ObjectFieldNode( + name: NameNode(value: 'id'), + value: VariableNode( + name: NameNode(value: 'productsId'))), + ObjectFieldNode( + name: NameNode(value: 'category'), + value: VariableNode(name: NameNode(value: 'catId'))) + ])), + ArgumentNode( + name: NameNode(value: 'orderBy'), + value: ObjectValueNode(fields: [ + ObjectFieldNode( + name: NameNode(value: 'field'), + value: VariableNode( + name: NameNode(value: 'fieldOfOrder'))), + ObjectFieldNode( + name: NameNode(value: 'order'), + value: + VariableNode(name: NameNode(value: 'orderType'))) + ])) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'paginatorInfo'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'Paging'), directives: []) + ])), + FieldNode( + name: NameNode(value: 'data'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'Product'), directives: []) + ])) + ])) + ])), + FragmentDefinitionNode( + name: NameNode(value: 'Paging'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'PaginatorInfo'), isNonNull: false)), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'count'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'currentPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'firstItem'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'lastItem'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'hasMorePages'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'lastPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'perPage'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'total'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FragmentDefinitionNode( + name: NameNode(value: 'Product'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'Product'), isNonNull: false)), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'averageRating'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'price'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'available'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'details'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'sku'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'description'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'cover'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'url'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'unit'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'media'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'url'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'category'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ])) + ]); + + @override + final String operationName = 'OrderProducts'; + + @override + final OrderProductsArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + OrderProducts$Query parse(Map json) => + OrderProducts$Query.fromJson(json); +} + +@JsonSerializable(explicitToJson: true) +class RelatedProductsArguments extends JsonSerializable with EquatableMixin { + RelatedProductsArguments({@required this.id}); + + @override + factory RelatedProductsArguments.fromJson(Map json) => + _$RelatedProductsArgumentsFromJson(json); + + final String id; + + @override + List get props => [id]; + @override + Map toJson() => _$RelatedProductsArgumentsToJson(this); +} + +class RelatedProductsQuery + extends GraphQLQuery { + RelatedProductsQuery({this.variables}); + + @override + final DocumentNode document = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'RelatedProducts'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'id')), + type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'relatedProducts'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'id'), + value: VariableNode(name: NameNode(value: 'id'))) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'Product'), directives: []) + ])) + ])), + FragmentDefinitionNode( + name: NameNode(value: 'Product'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'Product'), isNonNull: false)), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'averageRating'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'price'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'available'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'details'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'sku'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'description'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'cover'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'url'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'unit'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'media'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'url'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), + FieldNode( + name: NameNode(value: 'category'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])) + ])) + ])) + ]); + + @override + final String operationName = 'RelatedProducts'; + + @override + final RelatedProductsArguments variables; + + @override + List get props => [document, operationName, variables]; + @override + RelatedProducts$Query parse(Map json) => + RelatedProducts$Query.fromJson(json); +} + @JsonSerializable(explicitToJson: true) class ProductsArguments extends JsonSerializable with EquatableMixin { ProductsArguments( diff --git a/lib/generatedql/products/graphql_api.graphql.g.dart b/lib/generatedql/products/graphql_api.graphql.g.dart index 2c96532..fa7fca3 100644 --- a/lib/generatedql/products/graphql_api.graphql.g.dart +++ b/lib/generatedql/products/graphql_api.graphql.g.dart @@ -6,10 +6,10 @@ part of 'graphql_api.graphql.dart'; // JsonSerializableGenerator // ************************************************************************** -Products$Query$ProductPaginator$PaginatorInfo - _$Products$Query$ProductPaginator$PaginatorInfoFromJson( +OrderProducts$Query$ProductPaginator$PaginatorInfo + _$OrderProducts$Query$ProductPaginator$PaginatorInfoFromJson( Map json) { - return Products$Query$ProductPaginator$PaginatorInfo() + return OrderProducts$Query$ProductPaginator$PaginatorInfo() ..count = json['count'] as int ..currentPage = json['currentPage'] as int ..firstItem = json['firstItem'] as int @@ -20,8 +20,8 @@ Products$Query$ProductPaginator$PaginatorInfo ..total = json['total'] as int; } -Map _$Products$Query$ProductPaginator$PaginatorInfoToJson( - Products$Query$ProductPaginator$PaginatorInfo instance) => +Map _$OrderProducts$Query$ProductPaginator$PaginatorInfoToJson( + OrderProducts$Query$ProductPaginator$PaginatorInfo instance) => { 'count': instance.count, 'currentPage': instance.currentPage, @@ -33,10 +33,10 @@ Map _$Products$Query$ProductPaginator$PaginatorInfoToJson( 'total': instance.total, }; -Products$Query$ProductPaginator$Product - _$Products$Query$ProductPaginator$ProductFromJson( +OrderProducts$Query$ProductPaginator$Product + _$OrderProducts$Query$ProductPaginator$ProductFromJson( Map json) { - return Products$Query$ProductPaginator$Product() + return OrderProducts$Query$ProductPaginator$Product() ..id = json['id'] as String ..averageRating = json['averageRating'] as String ..price = json['price'] as String @@ -47,8 +47,8 @@ Products$Query$ProductPaginator$Product json['details'] as Map); } -Map _$Products$Query$ProductPaginator$ProductToJson( - Products$Query$ProductPaginator$Product instance) => +Map _$OrderProducts$Query$ProductPaginator$ProductToJson( + OrderProducts$Query$ProductPaginator$Product instance) => { 'id': instance.id, 'averageRating': instance.averageRating, @@ -57,37 +57,38 @@ Map _$Products$Query$ProductPaginator$ProductToJson( 'details': instance.details?.toJson(), }; -Products$Query$ProductPaginator _$Products$Query$ProductPaginatorFromJson( - Map json) { - return Products$Query$ProductPaginator() +OrderProducts$Query$ProductPaginator + _$OrderProducts$Query$ProductPaginatorFromJson(Map json) { + return OrderProducts$Query$ProductPaginator() ..paginatorInfo = json['paginatorInfo'] == null ? null - : Products$Query$ProductPaginator$PaginatorInfo.fromJson( + : OrderProducts$Query$ProductPaginator$PaginatorInfo.fromJson( json['paginatorInfo'] as Map) ..data = (json['data'] as List) ?.map((e) => e == null ? null - : Products$Query$ProductPaginator$Product.fromJson( + : OrderProducts$Query$ProductPaginator$Product.fromJson( e as Map)) ?.toList(); } -Map _$Products$Query$ProductPaginatorToJson( - Products$Query$ProductPaginator instance) => +Map _$OrderProducts$Query$ProductPaginatorToJson( + OrderProducts$Query$ProductPaginator instance) => { 'paginatorInfo': instance.paginatorInfo?.toJson(), 'data': instance.data?.map((e) => e?.toJson())?.toList(), }; -Products$Query _$Products$QueryFromJson(Map json) { - return Products$Query() +OrderProducts$Query _$OrderProducts$QueryFromJson(Map json) { + return OrderProducts$Query() ..products = json['products'] == null ? null - : Products$Query$ProductPaginator.fromJson( + : OrderProducts$Query$ProductPaginator.fromJson( json['products'] as Map); } -Map _$Products$QueryToJson(Products$Query instance) => +Map _$OrderProducts$QueryToJson( + OrderProducts$Query instance) => { 'products': instance.products?.toJson(), }; @@ -166,6 +167,217 @@ Map _$ProductMixin$ProductDataToJson( 'category': instance.category?.toJson(), }; +RelatedProducts$Query$Product _$RelatedProducts$Query$ProductFromJson( + Map json) { + return RelatedProducts$Query$Product() + ..id = json['id'] as String + ..averageRating = json['averageRating'] as String + ..price = json['price'] as String + ..available = json['available'] as bool + ..details = json['details'] == null + ? null + : ProductMixin$ProductData.fromJson( + json['details'] as Map); +} + +Map _$RelatedProducts$Query$ProductToJson( + RelatedProducts$Query$Product instance) => + { + 'id': instance.id, + 'averageRating': instance.averageRating, + 'price': instance.price, + 'available': instance.available, + 'details': instance.details?.toJson(), + }; + +RelatedProducts$Query _$RelatedProducts$QueryFromJson( + Map json) { + return RelatedProducts$Query() + ..relatedProducts = (json['relatedProducts'] as List) + ?.map((e) => e == null + ? null + : RelatedProducts$Query$Product.fromJson(e as Map)) + ?.toList(); +} + +Map _$RelatedProducts$QueryToJson( + RelatedProducts$Query instance) => + { + 'relatedProducts': + instance.relatedProducts?.map((e) => e?.toJson())?.toList(), + }; + +Products$Query$ProductPaginator$PaginatorInfo + _$Products$Query$ProductPaginator$PaginatorInfoFromJson( + Map json) { + return Products$Query$ProductPaginator$PaginatorInfo() + ..count = json['count'] as int + ..currentPage = json['currentPage'] as int + ..firstItem = json['firstItem'] as int + ..lastItem = json['lastItem'] as int + ..hasMorePages = json['hasMorePages'] as bool + ..lastPage = json['lastPage'] as int + ..perPage = json['perPage'] as int + ..total = json['total'] as int; +} + +Map _$Products$Query$ProductPaginator$PaginatorInfoToJson( + Products$Query$ProductPaginator$PaginatorInfo instance) => + { + 'count': instance.count, + 'currentPage': instance.currentPage, + 'firstItem': instance.firstItem, + 'lastItem': instance.lastItem, + 'hasMorePages': instance.hasMorePages, + 'lastPage': instance.lastPage, + 'perPage': instance.perPage, + 'total': instance.total, + }; + +Products$Query$ProductPaginator$Product + _$Products$Query$ProductPaginator$ProductFromJson( + Map json) { + return Products$Query$ProductPaginator$Product() + ..id = json['id'] as String + ..averageRating = json['averageRating'] as String + ..price = json['price'] as String + ..available = json['available'] as bool + ..details = json['details'] == null + ? null + : ProductMixin$ProductData.fromJson( + json['details'] as Map); +} + +Map _$Products$Query$ProductPaginator$ProductToJson( + Products$Query$ProductPaginator$Product instance) => + { + 'id': instance.id, + 'averageRating': instance.averageRating, + 'price': instance.price, + 'available': instance.available, + 'details': instance.details?.toJson(), + }; + +Products$Query$ProductPaginator _$Products$Query$ProductPaginatorFromJson( + Map json) { + return Products$Query$ProductPaginator() + ..paginatorInfo = json['paginatorInfo'] == null + ? null + : Products$Query$ProductPaginator$PaginatorInfo.fromJson( + json['paginatorInfo'] as Map) + ..data = (json['data'] as List) + ?.map((e) => e == null + ? null + : Products$Query$ProductPaginator$Product.fromJson( + e as Map)) + ?.toList(); +} + +Map _$Products$Query$ProductPaginatorToJson( + Products$Query$ProductPaginator instance) => + { + 'paginatorInfo': instance.paginatorInfo?.toJson(), + 'data': instance.data?.map((e) => e?.toJson())?.toList(), + }; + +Products$Query _$Products$QueryFromJson(Map json) { + return Products$Query() + ..products = json['products'] == null + ? null + : Products$Query$ProductPaginator.fromJson( + json['products'] as Map); +} + +Map _$Products$QueryToJson(Products$Query instance) => + { + 'products': instance.products?.toJson(), + }; + +OrderProductsArguments _$OrderProductsArgumentsFromJson( + Map json) { + return OrderProductsArguments( + first: json['first'] as int, + page: json['page'] as int, + productsId: json['productsId'] as String, + catId: (json['catId'] as List)?.map((e) => e as String)?.toList(), + name: json['name'] as String, + fieldOfOrder: _$enumDecodeNullable( + _$ProductsOrderByColumnEnumMap, json['fieldOfOrder'], + unknownValue: ProductsOrderByColumn.artemisUnknown), + orderType: _$enumDecodeNullable(_$SortOrderEnumMap, json['orderType'], + unknownValue: SortOrder.artemisUnknown), + ); +} + +Map _$OrderProductsArgumentsToJson( + OrderProductsArguments instance) => + { + 'first': instance.first, + 'page': instance.page, + 'productsId': instance.productsId, + 'catId': instance.catId, + 'name': instance.name, + 'fieldOfOrder': _$ProductsOrderByColumnEnumMap[instance.fieldOfOrder], + 'orderType': _$SortOrderEnumMap[instance.orderType], + }; + +T _$enumDecode( + Map enumValues, + dynamic source, { + T unknownValue, +}) { + if (source == null) { + throw ArgumentError('A value must be provided. Supported values: ' + '${enumValues.values.join(', ')}'); + } + + final value = enumValues.entries + .singleWhere((e) => e.value == source, orElse: () => null) + ?.key; + + if (value == null && unknownValue == null) { + throw ArgumentError('`$source` is not one of the supported values: ' + '${enumValues.values.join(', ')}'); + } + return value ?? unknownValue; +} + +T _$enumDecodeNullable( + Map enumValues, + dynamic source, { + T unknownValue, +}) { + if (source == null) { + return null; + } + return _$enumDecode(enumValues, source, unknownValue: unknownValue); +} + +const _$ProductsOrderByColumnEnumMap = { + ProductsOrderByColumn.id: 'ID', + ProductsOrderByColumn.name: 'NAME', + ProductsOrderByColumn.artemisUnknown: 'ARTEMIS_UNKNOWN', +}; + +const _$SortOrderEnumMap = { + SortOrder.asc: 'ASC', + SortOrder.desc: 'DESC', + SortOrder.artemisUnknown: 'ARTEMIS_UNKNOWN', +}; + +RelatedProductsArguments _$RelatedProductsArgumentsFromJson( + Map json) { + return RelatedProductsArguments( + id: json['id'] as String, + ); +} + +Map _$RelatedProductsArgumentsToJson( + RelatedProductsArguments instance) => + { + 'id': instance.id, + }; + ProductsArguments _$ProductsArgumentsFromJson(Map json) { return ProductsArguments( first: json['first'] as int, diff --git a/lib/generatedql/related_product/graphql_api.dart b/lib/generatedql/related_product/graphql_api.dart deleted file mode 100644 index 196c5cd..0000000 --- a/lib/generatedql/related_product/graphql_api.dart +++ /dev/null @@ -1,2 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND -export 'graphql_api.graphql.dart'; diff --git a/lib/generatedql/related_product/graphql_api.graphql.dart b/lib/generatedql/related_product/graphql_api.graphql.dart deleted file mode 100644 index 4f809ff..0000000 --- a/lib/generatedql/related_product/graphql_api.graphql.dart +++ /dev/null @@ -1,293 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -import 'package:meta/meta.dart'; -import 'package:artemis/artemis.dart'; -import 'package:json_annotation/json_annotation.dart'; -import 'package:equatable/equatable.dart'; -import 'package:gql/ast.dart'; -part 'graphql_api.graphql.g.dart'; - -mixin ProductMixin { - String id; - String averageRating; - String price; - bool available; - ProductMixin$ProductData details; -} - -@JsonSerializable(explicitToJson: true) -class RelatedProducts$Query$Product with EquatableMixin, ProductMixin { - RelatedProducts$Query$Product(); - - factory RelatedProducts$Query$Product.fromJson(Map json) => - _$RelatedProducts$Query$ProductFromJson(json); - - @override - List get props => [id, averageRating, price, available, details]; - Map toJson() => _$RelatedProducts$Query$ProductToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class RelatedProducts$Query with EquatableMixin { - RelatedProducts$Query(); - - factory RelatedProducts$Query.fromJson(Map json) => - _$RelatedProducts$QueryFromJson(json); - - List relatedProducts; - - @override - List get props => [relatedProducts]; - Map toJson() => _$RelatedProducts$QueryToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class ProductMixin$ProductData$Media with EquatableMixin { - ProductMixin$ProductData$Media(); - - factory ProductMixin$ProductData$Media.fromJson(Map json) => - _$ProductMixin$ProductData$MediaFromJson(json); - - String url; - - @override - List get props => [url]; - Map toJson() => _$ProductMixin$ProductData$MediaToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class ProductMixin$ProductData$Unit with EquatableMixin { - ProductMixin$ProductData$Unit(); - - factory ProductMixin$ProductData$Unit.fromJson(Map json) => - _$ProductMixin$ProductData$UnitFromJson(json); - - String id; - - String name; - - @override - List get props => [id, name]; - Map toJson() => _$ProductMixin$ProductData$UnitToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class ProductMixin$ProductData$Category with EquatableMixin { - ProductMixin$ProductData$Category(); - - factory ProductMixin$ProductData$Category.fromJson( - Map json) => - _$ProductMixin$ProductData$CategoryFromJson(json); - - String id; - - @override - List get props => [id]; - Map toJson() => - _$ProductMixin$ProductData$CategoryToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class ProductMixin$ProductData with EquatableMixin { - ProductMixin$ProductData(); - - factory ProductMixin$ProductData.fromJson(Map json) => - _$ProductMixin$ProductDataFromJson(json); - - String name; - - String sku; - - String description; - - ProductMixin$ProductData$Media cover; - - ProductMixin$ProductData$Unit unit; - - List media; - - ProductMixin$ProductData$Category category; - - @override - List get props => - [name, sku, description, cover, unit, media, category]; - Map toJson() => _$ProductMixin$ProductDataToJson(this); -} - -@JsonSerializable(explicitToJson: true) -class RelatedProductsArguments extends JsonSerializable with EquatableMixin { - RelatedProductsArguments({@required this.id}); - - @override - factory RelatedProductsArguments.fromJson(Map json) => - _$RelatedProductsArgumentsFromJson(json); - - final String id; - - @override - List get props => [id]; - @override - Map toJson() => _$RelatedProductsArgumentsToJson(this); -} - -class RelatedProductsQuery - extends GraphQLQuery { - RelatedProductsQuery({this.variables}); - - @override - final DocumentNode document = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'RelatedProducts'), - variableDefinitions: [ - VariableDefinitionNode( - variable: VariableNode(name: NameNode(value: 'id')), - type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true), - defaultValue: DefaultValueNode(value: null), - directives: []) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'relatedProducts'), - alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'id'), - value: VariableNode(name: NameNode(value: 'id'))) - ], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FragmentSpreadNode( - name: NameNode(value: 'Product'), directives: []) - ])) - ])), - FragmentDefinitionNode( - name: NameNode(value: 'Product'), - typeCondition: TypeConditionNode( - on: NamedTypeNode( - name: NameNode(value: 'Product'), isNonNull: false)), - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'averageRating'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'price'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'available'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'details'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'sku'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'description'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'cover'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'url'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'unit'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'media'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'url'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])), - FieldNode( - name: NameNode(value: 'category'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null) - ])) - ])) - ])) - ]); - - @override - final String operationName = 'RelatedProducts'; - - @override - final RelatedProductsArguments variables; - - @override - List get props => [document, operationName, variables]; - @override - RelatedProducts$Query parse(Map json) => - RelatedProducts$Query.fromJson(json); -} diff --git a/lib/generatedql/related_product/graphql_api.graphql.g.dart b/lib/generatedql/related_product/graphql_api.graphql.g.dart deleted file mode 100644 index 26646b4..0000000 --- a/lib/generatedql/related_product/graphql_api.graphql.g.dart +++ /dev/null @@ -1,134 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'graphql_api.graphql.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -RelatedProducts$Query$Product _$RelatedProducts$Query$ProductFromJson( - Map json) { - return RelatedProducts$Query$Product() - ..id = json['id'] as String - ..averageRating = json['averageRating'] as String - ..price = json['price'] as String - ..available = json['available'] as bool - ..details = json['details'] == null - ? null - : ProductMixin$ProductData.fromJson( - json['details'] as Map); -} - -Map _$RelatedProducts$Query$ProductToJson( - RelatedProducts$Query$Product instance) => - { - 'id': instance.id, - 'averageRating': instance.averageRating, - 'price': instance.price, - 'available': instance.available, - 'details': instance.details?.toJson(), - }; - -RelatedProducts$Query _$RelatedProducts$QueryFromJson( - Map json) { - return RelatedProducts$Query() - ..relatedProducts = (json['relatedProducts'] as List) - ?.map((e) => e == null - ? null - : RelatedProducts$Query$Product.fromJson(e as Map)) - ?.toList(); -} - -Map _$RelatedProducts$QueryToJson( - RelatedProducts$Query instance) => - { - 'relatedProducts': - instance.relatedProducts?.map((e) => e?.toJson())?.toList(), - }; - -ProductMixin$ProductData$Media _$ProductMixin$ProductData$MediaFromJson( - Map json) { - return ProductMixin$ProductData$Media()..url = json['url'] as String; -} - -Map _$ProductMixin$ProductData$MediaToJson( - ProductMixin$ProductData$Media instance) => - { - 'url': instance.url, - }; - -ProductMixin$ProductData$Unit _$ProductMixin$ProductData$UnitFromJson( - Map json) { - return ProductMixin$ProductData$Unit() - ..id = json['id'] as String - ..name = json['name'] as String; -} - -Map _$ProductMixin$ProductData$UnitToJson( - ProductMixin$ProductData$Unit instance) => - { - 'id': instance.id, - 'name': instance.name, - }; - -ProductMixin$ProductData$Category _$ProductMixin$ProductData$CategoryFromJson( - Map json) { - return ProductMixin$ProductData$Category()..id = json['id'] as String; -} - -Map _$ProductMixin$ProductData$CategoryToJson( - ProductMixin$ProductData$Category instance) => - { - 'id': instance.id, - }; - -ProductMixin$ProductData _$ProductMixin$ProductDataFromJson( - Map json) { - return ProductMixin$ProductData() - ..name = json['name'] as String - ..sku = json['sku'] as String - ..description = json['description'] as String - ..cover = json['cover'] == null - ? null - : ProductMixin$ProductData$Media.fromJson( - json['cover'] as Map) - ..unit = json['unit'] == null - ? null - : ProductMixin$ProductData$Unit.fromJson( - json['unit'] as Map) - ..media = (json['media'] as List) - ?.map((e) => e == null - ? null - : ProductMixin$ProductData$Media.fromJson( - e as Map)) - ?.toList() - ..category = json['category'] == null - ? null - : ProductMixin$ProductData$Category.fromJson( - json['category'] as Map); -} - -Map _$ProductMixin$ProductDataToJson( - ProductMixin$ProductData instance) => - { - 'name': instance.name, - 'sku': instance.sku, - 'description': instance.description, - 'cover': instance.cover?.toJson(), - 'unit': instance.unit?.toJson(), - 'media': instance.media?.map((e) => e?.toJson())?.toList(), - 'category': instance.category?.toJson(), - }; - -RelatedProductsArguments _$RelatedProductsArgumentsFromJson( - Map json) { - return RelatedProductsArguments( - id: json['id'] as String, - ); -} - -Map _$RelatedProductsArgumentsToJson( - RelatedProductsArguments instance) => - { - 'id': instance.id, - }; diff --git a/lib/graphql/order_products/order_product.graphql b/lib/graphql/products/order_product.graphql similarity index 100% rename from lib/graphql/order_products/order_product.graphql rename to lib/graphql/products/order_product.graphql diff --git a/lib/graphql/related_product/related_product.graphql b/lib/graphql/products/related_product.graphql similarity index 100% rename from lib/graphql/related_product/related_product.graphql rename to lib/graphql/products/related_product.graphql diff --git a/lib/mmd_ecommerce.dart b/lib/mmd_ecommerce.dart index a3f9a3a..44b5d3a 100644 --- a/lib/mmd_ecommerce.dart +++ b/lib/mmd_ecommerce.dart @@ -13,14 +13,6 @@ export './apis/cart_api_manager.dart'; export './apis/address_api_manager.dart'; export './common_models/common_models.dart'; export './generatedql/products/graphql_api.dart'; -export './generatedql/order_products/graphql_api.dart' - hide - PagingMixin, - ProductMixin, - ProductMixin$ProductData$Unit, - ProductMixin$ProductData$Media, - ProductMixin$ProductData, - ProductMixin$ProductData$Category; export './generatedql/cart/graphql_api.dart' hide @@ -29,13 +21,7 @@ export './generatedql/cart/graphql_api.dart' ProductMixin$ProductData$Media, ProductMixin$ProductData, ProductMixin$ProductData$Category; -export './generatedql/related_product/graphql_api.dart' - hide - ProductMixin, - ProductMixin$ProductData$Unit, - ProductMixin$ProductData$Media, - ProductMixin$ProductData, - ProductMixin$ProductData$Category; + export './generatedql/ratings/graphql_api.dart' hide PagingMixin; export './generatedql/categories/graphql_api.dart'; export './generatedql/orders/graphql_api.dart' hide PagingMixin; From 6e4e86cc4d47da36fa655502a84c0902dc06ff59 Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Sun, 27 Sep 2020 22:03:42 +0200 Subject: [PATCH 18/24] update mmd_ecommerce.dart and update example --- example/lib/apis/address_apis.dart | 9 +++------ example/lib/apis/auth_apis.dart | 7 ++++--- example/lib/apis/cart_api.dart | 6 +++--- example/lib/apis/general_api.dart | 4 ++-- example/lib/apis/product_apis.dart | 24 +++++++++++------------- example/lib/apis/user_apis.dart | 10 ++++------ example/lib/main.dart | 1 - lib/apis/general_api_manager.dart | 5 +++-- lib/apis/product_api_manager.dart | 3 ++- lib/common_models/common_models.dart | 11 +++++++---- lib/mmd_ecommerce.dart | 23 ++--------------------- 11 files changed, 41 insertions(+), 62 deletions(-) diff --git a/example/lib/apis/address_apis.dart b/example/lib/apis/address_apis.dart index 9cdd62a..8f54bfe 100644 --- a/example/lib/apis/address_apis.dart +++ b/example/lib/apis/address_apis.dart @@ -2,10 +2,7 @@ import 'package:mmd_ecommerce_fl_lib/mmd_ecommerce.dart'; getAllAddress() async { await AddressApiManager.addressesApi( - 5, - 1, - (GetAllAddress$Query$UserAddressPaginator addressPaginator) {}, - (ApiErrorModel error) {}); + 5, 1, (AddressesModel addressPaginator) {}, (ApiErrorModel error) {}); } createAddress() async { @@ -46,11 +43,11 @@ deleteAddress() async { getCitiesAsset() async { await AddressApiManager.citiesApi( - (List list) {}, (ApiErrorModel error) {}); + (CitiesModel citiesModel) {}, (ApiErrorModel error) {}); } getAreaByIdAsset(String cityId) async { - await AddressApiManager.areaByIdApi(cityId, (List list) { + await AddressApiManager.areaByIdApi(cityId, (AreasModel areasModel) { // }, (ApiErrorModel error) {}); } diff --git a/example/lib/apis/auth_apis.dart b/example/lib/apis/auth_apis.dart index 4b1a876..b8dd61f 100644 --- a/example/lib/apis/auth_apis.dart +++ b/example/lib/apis/auth_apis.dart @@ -2,15 +2,16 @@ import 'package:mmd_ecommerce_fl_lib/mmd_ecommerce.dart'; callLoginApi() async { await AuthApiManager.loginApi("test@mail.com", "123456789", "123", - (SignIn$Mutation$AuthPayload authPayload) async { + (AuthPayloadLoginModel userRegisterModel) async { MmdECommerceFlLib.submitTokeAndTokenType( - authPayload.accessToken, authPayload.tokenType); + userRegisterModel.authPayload.accessToken, + userRegisterModel.authPayload.tokenType); }, (ApiErrorModel error) {}); } callRegisterApi() { AuthApiManager.registerApi("mmd10", "rovox4067sri@ka0525.com", "123456", - (SignUp$Mutation$User register) {}, (ApiErrorModel error) {}); + (UserRegisterModel register) {}, (ApiErrorModel error) {}); } callForgetPasswordApi(String email) { diff --git a/example/lib/apis/cart_api.dart b/example/lib/apis/cart_api.dart index 39032d0..ffa1c8c 100644 --- a/example/lib/apis/cart_api.dart +++ b/example/lib/apis/cart_api.dart @@ -1,8 +1,8 @@ import 'package:mmd_ecommerce_fl_lib/mmd_ecommerce.dart'; getVoucherByCode() async { - await CartApiManager.voucherByCodeApi("2121", - (GetVoucherByCode$Query$Voucher voucher) {}, (ApiErrorModel error) {}); + await CartApiManager.voucherByCodeApi( + "2121", (VoucherModel voucher) {}, (ApiErrorModel error) {}); } shippingFeesApi() async { @@ -17,5 +17,5 @@ addToCard() async { getCard() async { await CartApiManager.cartDataApi( - (GetCart$Query$Cart cart) {}, (ApiErrorModel error) {}); + (CartModel cart) {}, (ApiErrorModel error) {}); } diff --git a/example/lib/apis/general_api.dart b/example/lib/apis/general_api.dart index 4f0a71e..1d0f7df 100644 --- a/example/lib/apis/general_api.dart +++ b/example/lib/apis/general_api.dart @@ -1,10 +1,10 @@ import 'package:mmd_ecommerce_fl_lib/mmd_ecommerce.dart'; callBrandsApi() { - GeneralApiManager.brandsApi((List brands) {}, () {}); + GeneralApiManager.brandsApi((BrandModel brands) {}, () {}); } sliderApi() async { await GeneralApiManager.sliderApi( - (List list) {}, (ApiErrorModel error) {}); + (SliderModel sliderModel) {}, (ApiErrorModel error) {}); } diff --git a/example/lib/apis/product_apis.dart b/example/lib/apis/product_apis.dart index 8163c79..3654f36 100644 --- a/example/lib/apis/product_apis.dart +++ b/example/lib/apis/product_apis.dart @@ -2,17 +2,17 @@ import 'package:mmd_ecommerce_fl_lib/mmd_ecommerce.dart'; categoriesApi() async { await GeneralApiManager.categoriesApi( - (List list) {}, (ApiErrorModel error) {}); + (CategoriesModel categoriesModel) {}, (ApiErrorModel error) {}); } productApi() async { - await ProductApiManager.productsApi(10, 1, - (Products$Query$ProductPaginator item) {}, (ApiErrorModel error) {}); + await ProductApiManager.productsApi( + 10, 1, (ProductsPaginatorModel item) {}, (ApiErrorModel error) {}); } productByCategoryIdApi() async { - await ProductApiManager.productByCategoryIdApi(10, 1, "1", - (Products$Query$ProductPaginator item) {}, (ApiErrorModel error) {}); + await ProductApiManager.productByCategoryIdApi( + 10, 1, "1", (ProductsPaginatorModel item) {}, (ApiErrorModel error) {}); } newProductApi() async { @@ -21,20 +21,18 @@ newProductApi() async { 1, SortOrder.desc, ProductsOrderByColumn.id, - (OrderProducts$Query$ProductPaginator item) {}, + (OrderProductsModel item) {}, (ApiErrorModel error) {}); } getProductDetailsApi() async { await ProductApiManager.productDetailsApi( - "1", - (Products$Query$ProductPaginator$Product item) {}, - (ApiErrorModel error) {}); + "1", (ProductModel item) {}, (ApiErrorModel error) {}); } productByNameApi() async { - await ProductApiManager.productsByNameApi(10, 1, "ad", - (Products$Query$ProductPaginator item) {}, (ApiErrorModel error) {}); + await ProductApiManager.productsByNameApi( + 10, 1, "ad", (ProductsPaginatorModel item) {}, (ApiErrorModel error) {}); } relatedProductByIdApi() async { @@ -43,6 +41,6 @@ relatedProductByIdApi() async { } getRatingsForProductApi() async { - await ProductApiManager.reviewsForProductApi(10, 1, "1", - (Ratings$Query$RatingPaginator item) {}, (ApiErrorModel error) {}); + await ProductApiManager.reviewsForProductApi( + 10, 1, "1", (RatingPaginatorModel item) {}, (ApiErrorModel error) {}); } diff --git a/example/lib/apis/user_apis.dart b/example/lib/apis/user_apis.dart index 0f3d7dd..7401f44 100644 --- a/example/lib/apis/user_apis.dart +++ b/example/lib/apis/user_apis.dart @@ -6,7 +6,7 @@ callUpdateProfileApi(String name, String mobile) { } callMyProfileApi() { - UserApiManager.myProfileApi((Profile$Query$User user) { + UserApiManager.myProfileApi((UserProfileModel user) { // // @@ -21,13 +21,11 @@ callMyProfileApi() { callRefreshTokenApi(String refreshToken) { // var token = "def50200ff07466059c5bfbf0689902c06002bb5990e9c4ea0d8750c51e07b42ae1e86072c400ae807c7e06e9cac45864abb0c7a910ce9eb2ad629e495a73caca9fd32c3ee756580f62b883008ef03eb5dc91d48724ec4ffe595c4a72d832d8420eac5cced2a6e000ebd7bf2db21534970a8eca26121e760b7dfdda3652416d2c4f756f5eaa46605a7b6377238257f3b3fee3dff2763e227b2c8657fb46c549e76a6e825af62db5d5c77813eac04162a7118145890ec2182d4603dcce28e24d910a148dc50345ed199ab851e59f939c0d27205458fb823e949d1af4af461922c1bf75cccc8f680c740680e50d7242f50128f2cc1b184ae6a06da2f17ea7a7eb8203d37fff5aab86abaab64e9ea9d661985fd015cc393872bea47f633ce6baf91e4be0c439df984452c74359619b2e764bf4e7d073bfd120fca3b5bda6b3777a4f4fddb0b72590dacf9f7ea661c415b724da74ddc0113f48c6ff1ecd6de4567c6a077f0e6"; - UserApiManager.refreshTokenApi( - refreshToken, - (RefreshToken$Mutation$AuthPayload authPayload) {}, - (ApiErrorModel error) {}); + UserApiManager.refreshTokenApi(refreshToken, + (AuthPayloadRefreshTokenModel authPayload) {}, (ApiErrorModel error) {}); } getAllOrdersApi() { UserApiManager.allOrdersApi( - 20, 1, (Orders$Query$OrderPaginator orders) {}, (ApiErrorModel error) {}); + 20, 1, (OrdersModel orders) {}, (ApiErrorModel error) {}); } diff --git a/example/lib/main.dart b/example/lib/main.dart index fc41f49..af1c72d 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -35,7 +35,6 @@ class MyHomePage extends StatefulWidget { class _MyHomePageState extends State { var isLoading = false; - SignIn$Mutation$AuthPayload auth; var isError = false; TextEditingController emailController = TextEditingController(); diff --git a/lib/apis/general_api_manager.dart b/lib/apis/general_api_manager.dart index 0ebbb74..b407438 100644 --- a/lib/apis/general_api_manager.dart +++ b/lib/apis/general_api_manager.dart @@ -13,7 +13,7 @@ class GeneralApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(Brands$Query.fromJson(result.data).brands); + success(BrandModel(Brands$Query.fromJson(result.data).brands)); } } @@ -33,7 +33,8 @@ class GeneralApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(CategoryModel(Categories$Query.fromJson(result.data).categories)); + success( + CategoriesModel(Categories$Query.fromJson(result.data).categories)); } } } diff --git a/lib/apis/product_api_manager.dart b/lib/apis/product_api_manager.dart index 40f09bc..83934c6 100644 --- a/lib/apis/product_api_manager.dart +++ b/lib/apis/product_api_manager.dart @@ -1,6 +1,7 @@ import 'package:graphql_flutter/graphql_flutter.dart'; import 'package:mmd_ecommerce_fl_lib/apis/base/base_api_manager.dart'; -import 'package:mmd_ecommerce_fl_lib/mmd_ecommerce.dart'; +import 'package:mmd_ecommerce_fl_lib/generatedql/products/graphql_api.dart'; +import 'package:mmd_ecommerce_fl_lib/generatedql/ratings/graphql_api.dart'; import '../mmd_ecommerce.dart'; diff --git a/lib/common_models/common_models.dart b/lib/common_models/common_models.dart index d12ba28..34061da 100644 --- a/lib/common_models/common_models.dart +++ b/lib/common_models/common_models.dart @@ -2,10 +2,8 @@ import 'package:mmd_ecommerce_fl_lib/generatedql/auth/graphql_api.graphql.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/cart/graphql_api.graphql.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/categories/graphql_api.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/general/graphql_api.dart'; -// import 'package:mmd_ecommerce_fl_lib/generatedql/order_products/graphql_api.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/products/graphql_api.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/ratings/graphql_api.graphql.dart'; -// import 'package:mmd_ecommerce_fl_lib/generatedql/related_product/graphql_api.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/user/graphql_api.graphql.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/address/graphql_api.graphql.dart'; import 'package:mmd_ecommerce_fl_lib/generatedql/address_asset/graphql_api.graphql.dart'; @@ -72,9 +70,9 @@ class SliderModel { SliderModel(this.slider); } -class CategoryModel { +class CategoriesModel { final List category; - CategoryModel(this.category); + CategoriesModel(this.category); } class ProductsPaginatorModel { @@ -101,3 +99,8 @@ class OrderProductsModel { final OrderProducts$Query$ProductPaginator orderProducts; OrderProductsModel(this.orderProducts); } + +class BrandModel { + final List brand; + BrandModel(this.brand); +} diff --git a/lib/mmd_ecommerce.dart b/lib/mmd_ecommerce.dart index 44b5d3a..cc2a938 100644 --- a/lib/mmd_ecommerce.dart +++ b/lib/mmd_ecommerce.dart @@ -12,27 +12,8 @@ export './apis/product_api_manager.dart'; export './apis/cart_api_manager.dart'; export './apis/address_api_manager.dart'; export './common_models/common_models.dart'; -export './generatedql/products/graphql_api.dart'; +export './generatedql/products/graphql_api.dart' + show SortOrder, ProductsOrderByColumn; -export './generatedql/cart/graphql_api.dart' - hide - ProductMixin, - ProductMixin$ProductData$Unit, - ProductMixin$ProductData$Media, - ProductMixin$ProductData, - ProductMixin$ProductData$Category; - -export './generatedql/ratings/graphql_api.dart' hide PagingMixin; -export './generatedql/categories/graphql_api.dart'; -export './generatedql/orders/graphql_api.dart' hide PagingMixin; -export './generatedql/auth/graphql_api.dart'; -export './generatedql/general/graphql_api.dart'; -export './generatedql/user/graphql_api.dart' hide UserMixin, AuthPayloadMixin; -export './generatedql/address_asset/graphql_api.dart'; -export './generatedql/address/graphql_api.dart' hide PagingMixin; export './mmd_ecommerce.dart'; export './mmd_ecommerce_fl_lib.dart'; - -/// we hide the AuthPayload from "./generatedql/user/graphql_api.dart" -/// because we use the same name with "./generatedql/auth/graphql_api.dart" -/// guide link --> https://stackoverflow.com/a/22496742/2172590 From 5c7b785a987466a860207bac70a265c94bde9c12 Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Sun, 27 Sep 2020 23:08:38 +0200 Subject: [PATCH 19/24] convert print to debugPrint --- lib/apis/logger/logger_helper.dart | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/apis/logger/logger_helper.dart b/lib/apis/logger/logger_helper.dart index 529a7b0..16a928a 100644 --- a/lib/apis/logger/logger_helper.dart +++ b/lib/apis/logger/logger_helper.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:http/http.dart'; class LoggerHelper { @@ -11,20 +12,21 @@ class LoggerHelper { static const loggerStatusCode = "$loggerTag statusCode $loggerSeparator"; static const loggerBody = "$loggerTag body $loggerSeparator"; - static void print2Lines() => print(loggerLine + "\n" + loggerLine); + static void print2Lines() => debugPrint(loggerLine + "\n" + loggerLine); - static void printUrl(dynamic url) => print("$loggerUrl $url"); + static void printUrl(dynamic url) => debugPrint("$loggerUrl $url"); static void printHeaders(Map headers) => - print("$loggerHeaders $headers"); + debugPrint("$loggerHeaders $headers"); - static void printStatusCode(int code) => print("$loggerStatusCode $code"); + static void printStatusCode(int code) => + debugPrint("$loggerStatusCode $code"); - static void printBody(String body) => print("$loggerBody $body"); + static void printBody(String body) => debugPrint("$loggerBody $body"); static void logRequest(dynamic url, Map headers) { print2Lines(); - print(loggerRequest); + debugPrint(loggerRequest); printUrl(url); printHeaders(headers); print2Lines(); @@ -32,7 +34,7 @@ class LoggerHelper { static void logResponse(Response response) { print2Lines(); - print(loggerResponse); + debugPrint(loggerResponse); printUrl(response.request.url); printHeaders(response.headers); printStatusCode(response.statusCode); From 3bbeb7b5927c115736e1861934f11ef1f105643f Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Mon, 28 Sep 2020 01:11:34 +0200 Subject: [PATCH 20/24] update common_models --- example/lib/apis/general_api.dart | 2 +- lib/apis/general_api_manager.dart | 2 +- lib/common_models/common_models.dart | 30 +++++++++++++++++++++++----- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/example/lib/apis/general_api.dart b/example/lib/apis/general_api.dart index 1d0f7df..48720b3 100644 --- a/example/lib/apis/general_api.dart +++ b/example/lib/apis/general_api.dart @@ -6,5 +6,5 @@ callBrandsApi() { sliderApi() async { await GeneralApiManager.sliderApi( - (SliderModel sliderModel) {}, (ApiErrorModel error) {}); + (SlidersModel sliderModel) {}, (ApiErrorModel error) {}); } diff --git a/lib/apis/general_api_manager.dart b/lib/apis/general_api_manager.dart index b407438..82ee16d 100644 --- a/lib/apis/general_api_manager.dart +++ b/lib/apis/general_api_manager.dart @@ -23,7 +23,7 @@ class GeneralApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(SliderModel(Sliders$Query.fromJson(result.data).sliders)); + success(SlidersModel(Sliders$Query.fromJson(result.data).sliders)); } } diff --git a/lib/common_models/common_models.dart b/lib/common_models/common_models.dart index 34061da..48b33cd 100644 --- a/lib/common_models/common_models.dart +++ b/lib/common_models/common_models.dart @@ -40,11 +40,21 @@ class AddressesModel { AddressesModel(this.addressPaginator); } +class CityModel { + final Cities$Query$City city; + CityModel(this.city); +} + class CitiesModel { final List cities; CitiesModel(this.cities); } +class AreaModel { + final AreaByID$Query$Area area; + AreaModel(this.area); +} + class AreasModel { final List areas; AreasModel(this.areas); @@ -65,14 +75,24 @@ class VoucherModel { VoucherModel(this.voucherByCode); } -class SliderModel { - final List slider; - SliderModel(this.slider); +// class SliderModel { +// final Sliders$Query$Slider slider; +// SliderModel(this.slider); +// } + +class SlidersModel { + final List sliders; + SlidersModel(this.sliders); +} + +class CategoryModel { + final Categories$Query$Category category; + CategoryModel(this.category); } class CategoriesModel { - final List category; - CategoriesModel(this.category); + final List categories; + CategoriesModel(this.categories); } class ProductsPaginatorModel { From 20318d0025d340c1c6387dc1eee0a4d4e793c251 Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Mon, 28 Sep 2020 01:23:18 +0200 Subject: [PATCH 21/24] update common_models --- lib/common_models/common_models.dart | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/common_models/common_models.dart b/lib/common_models/common_models.dart index 48b33cd..918061e 100644 --- a/lib/common_models/common_models.dart +++ b/lib/common_models/common_models.dart @@ -75,10 +75,10 @@ class VoucherModel { VoucherModel(this.voucherByCode); } -// class SliderModel { -// final Sliders$Query$Slider slider; -// SliderModel(this.slider); -// } +class SliderModel { + final Sliders$Query$Slider slider; + SliderModel(this.slider); +} class SlidersModel { final List sliders; @@ -124,3 +124,8 @@ class BrandModel { final List brand; BrandModel(this.brand); } + +class CartItemModel { + final GetCart$Query$Cart$CartItem CartItem; + CartItemModel(this.CartItem); +} From 71211481312aae682e05e66ef9de1df1e4bc56b9 Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Mon, 28 Sep 2020 01:25:31 +0200 Subject: [PATCH 22/24] update common_models --- lib/common_models/common_models.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common_models/common_models.dart b/lib/common_models/common_models.dart index 918061e..ce041d0 100644 --- a/lib/common_models/common_models.dart +++ b/lib/common_models/common_models.dart @@ -126,6 +126,6 @@ class BrandModel { } class CartItemModel { - final GetCart$Query$Cart$CartItem CartItem; - CartItemModel(this.CartItem); + final GetCart$Query$Cart$CartItem cartItem; + CartItemModel(this.cartItem); } From c90feae613be8992cf41561d484cac881132da9a Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Tue, 29 Sep 2020 14:26:23 +0200 Subject: [PATCH 23/24] update .gitignore --- .gitignore | 1 - example/lib/api_keys.dart | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 example/lib/api_keys.dart diff --git a/.gitignore b/.gitignore index 1965c93..27fc1cb 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,6 @@ build/ # If you're building an application, you may want to check-in your pubspec.lock pubspec.lock -example/lib/api_keys.dart # Directory created by dartdoc # If you don't generate documentation locally you can remove this line. diff --git a/example/lib/api_keys.dart b/example/lib/api_keys.dart new file mode 100644 index 0000000..e8d247b --- /dev/null +++ b/example/lib/api_keys.dart @@ -0,0 +1 @@ +const BASE_URL = "https://egfoods.moselaymdserver.com"; From 9e5b97407b9d92d237292b9f2d2c7ce062c1a332 Mon Sep 17 00:00:00 2001 From: Beshoy Melika Date: Thu, 1 Oct 2020 13:26:52 +0200 Subject: [PATCH 24/24] fixed comments --- example/lib/apis/address_apis.dart | 6 ++-- example/lib/apis/cart_api.dart | 3 +- example/lib/apis/general_api.dart | 4 +-- example/lib/apis/product_apis.dart | 16 +++++----- example/lib/apis/user_apis.dart | 2 +- example/lib/main.dart | 1 - lib/apis/address_api_manager.dart | 8 ++--- lib/apis/cart_api_manager.dart | 2 +- lib/apis/general_api_manager.dart | 6 ++-- lib/apis/product_api_manager.dart | 12 +++---- lib/apis/user_api_manager.dart | 2 +- lib/common_models/common_models.dart | 47 +++++++++++++--------------- lib/mmd_ecommerce_fl_lib.dart | 1 - 13 files changed, 52 insertions(+), 58 deletions(-) diff --git a/example/lib/apis/address_apis.dart b/example/lib/apis/address_apis.dart index 8f54bfe..c07e5b7 100644 --- a/example/lib/apis/address_apis.dart +++ b/example/lib/apis/address_apis.dart @@ -2,7 +2,7 @@ import 'package:mmd_ecommerce_fl_lib/mmd_ecommerce.dart'; getAllAddress() async { await AddressApiManager.addressesApi( - 5, 1, (AddressesModel addressPaginator) {}, (ApiErrorModel error) {}); + 5, 1, (AddressesWrapper addressPaginator) {}, (ApiErrorModel error) {}); } createAddress() async { @@ -43,11 +43,11 @@ deleteAddress() async { getCitiesAsset() async { await AddressApiManager.citiesApi( - (CitiesModel citiesModel) {}, (ApiErrorModel error) {}); + (CitiesList citiesModel) {}, (ApiErrorModel error) {}); } getAreaByIdAsset(String cityId) async { - await AddressApiManager.areaByIdApi(cityId, (AreasModel areasModel) { + await AddressApiManager.areaByIdApi(cityId, (AreasList areasModel) { // }, (ApiErrorModel error) {}); } diff --git a/example/lib/apis/cart_api.dart b/example/lib/apis/cart_api.dart index ffa1c8c..1d70dac 100644 --- a/example/lib/apis/cart_api.dart +++ b/example/lib/apis/cart_api.dart @@ -16,6 +16,5 @@ addToCard() async { } getCard() async { - await CartApiManager.cartDataApi( - (CartModel cart) {}, (ApiErrorModel error) {}); + await CartApiManager.cartApi((CartModel cart) {}, (ApiErrorModel error) {}); } diff --git a/example/lib/apis/general_api.dart b/example/lib/apis/general_api.dart index 48720b3..2222283 100644 --- a/example/lib/apis/general_api.dart +++ b/example/lib/apis/general_api.dart @@ -1,10 +1,10 @@ import 'package:mmd_ecommerce_fl_lib/mmd_ecommerce.dart'; callBrandsApi() { - GeneralApiManager.brandsApi((BrandModel brands) {}, () {}); + GeneralApiManager.brandsApi((BrandList brands) {}, () {}); } sliderApi() async { await GeneralApiManager.sliderApi( - (SlidersModel sliderModel) {}, (ApiErrorModel error) {}); + (SliderList sliderModel) {}, (ApiErrorModel error) {}); } diff --git a/example/lib/apis/product_apis.dart b/example/lib/apis/product_apis.dart index 3654f36..c7e55e2 100644 --- a/example/lib/apis/product_apis.dart +++ b/example/lib/apis/product_apis.dart @@ -2,17 +2,17 @@ import 'package:mmd_ecommerce_fl_lib/mmd_ecommerce.dart'; categoriesApi() async { await GeneralApiManager.categoriesApi( - (CategoriesModel categoriesModel) {}, (ApiErrorModel error) {}); + (CategoriesList categoriesModel) {}, (ApiErrorModel error) {}); } productApi() async { await ProductApiManager.productsApi( - 10, 1, (ProductsPaginatorModel item) {}, (ApiErrorModel error) {}); + 10, 1, (ProductsPaginatorWrapper item) {}, (ApiErrorModel error) {}); } productByCategoryIdApi() async { await ProductApiManager.productByCategoryIdApi( - 10, 1, "1", (ProductsPaginatorModel item) {}, (ApiErrorModel error) {}); + 10, 1, "1", (ProductsPaginatorWrapper item) {}, (ApiErrorModel error) {}); } newProductApi() async { @@ -21,7 +21,7 @@ newProductApi() async { 1, SortOrder.desc, ProductsOrderByColumn.id, - (OrderProductsModel item) {}, + (OrderProductsWrapper item) {}, (ApiErrorModel error) {}); } @@ -31,16 +31,16 @@ getProductDetailsApi() async { } productByNameApi() async { - await ProductApiManager.productsByNameApi( - 10, 1, "ad", (ProductsPaginatorModel item) {}, (ApiErrorModel error) {}); + await ProductApiManager.productsByNameApi(10, 1, "ad", + (ProductsPaginatorWrapper item) {}, (ApiErrorModel error) {}); } relatedProductByIdApi() async { await ProductApiManager.relatedProductsByIdApi( - "1", (RelatedProductsModel items) {}, (ApiErrorModel error) {}); + "1", (RelatedProductsList items) {}, (ApiErrorModel error) {}); } getRatingsForProductApi() async { await ProductApiManager.reviewsForProductApi( - 10, 1, "1", (RatingPaginatorModel item) {}, (ApiErrorModel error) {}); + 10, 1, "1", (RatingPaginatorWrapper item) {}, (ApiErrorModel error) {}); } diff --git a/example/lib/apis/user_apis.dart b/example/lib/apis/user_apis.dart index 7401f44..7cf5e87 100644 --- a/example/lib/apis/user_apis.dart +++ b/example/lib/apis/user_apis.dart @@ -27,5 +27,5 @@ callRefreshTokenApi(String refreshToken) { getAllOrdersApi() { UserApiManager.allOrdersApi( - 20, 1, (OrdersModel orders) {}, (ApiErrorModel error) {}); + 20, 1, (OrdersWrapper orders) {}, (ApiErrorModel error) {}); } diff --git a/example/lib/main.dart b/example/lib/main.dart index af1c72d..57d020f 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -9,7 +9,6 @@ import 'apis/user_apis.dart'; import 'screens/product_screen.dart'; void main() { - // TODO remove the base url from the main example. [May be not because the graphConfig file] runApp(MyApp()); } diff --git a/lib/apis/address_api_manager.dart b/lib/apis/address_api_manager.dart index 738477b..63d8ddc 100644 --- a/lib/apis/address_api_manager.dart +++ b/lib/apis/address_api_manager.dart @@ -93,8 +93,8 @@ class AddressApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success( - AddressesModel(GetAllAddress$Query.fromJson(result.data).addresses)); + success(AddressesWrapper( + GetAllAddress$Query.fromJson(result.data).addresses)); } } @@ -104,7 +104,7 @@ class AddressApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(CitiesModel(Cities$Query.fromJson(result.data).cities)); + success(CitiesList(Cities$Query.fromJson(result.data).cities)); } } @@ -116,7 +116,7 @@ class AddressApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(AreasModel(AreaByID$Query.fromJson(result.data).areas)); + success(AreasList(AreaByID$Query.fromJson(result.data).areas)); } } } diff --git a/lib/apis/cart_api_manager.dart b/lib/apis/cart_api_manager.dart index 3a6598f..3137219 100644 --- a/lib/apis/cart_api_manager.dart +++ b/lib/apis/cart_api_manager.dart @@ -18,7 +18,7 @@ class CartApiManager extends BaseApiManager { } } - static Future cartDataApi(Function success, Function fail) async { + static Future cartApi(Function success, Function fail) async { var result = await BaseApiManager.mainClient().query(QueryOptions( documentNode: GetCartQuery().document, fetchPolicy: FetchPolicy.noCache)); diff --git a/lib/apis/general_api_manager.dart b/lib/apis/general_api_manager.dart index 82ee16d..d7e4ad1 100644 --- a/lib/apis/general_api_manager.dart +++ b/lib/apis/general_api_manager.dart @@ -13,7 +13,7 @@ class GeneralApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(BrandModel(Brands$Query.fromJson(result.data).brands)); + success(BrandList(Brands$Query.fromJson(result.data).brands)); } } @@ -23,7 +23,7 @@ class GeneralApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(SlidersModel(Sliders$Query.fromJson(result.data).sliders)); + success(SliderList(Sliders$Query.fromJson(result.data).sliders)); } } @@ -34,7 +34,7 @@ class GeneralApiManager extends BaseApiManager { fail(ApiErrorHelper.handle(result)); } else { success( - CategoriesModel(Categories$Query.fromJson(result.data).categories)); + CategoriesList(Categories$Query.fromJson(result.data).categories)); } } } diff --git a/lib/apis/product_api_manager.dart b/lib/apis/product_api_manager.dart index 83934c6..75493cb 100644 --- a/lib/apis/product_api_manager.dart +++ b/lib/apis/product_api_manager.dart @@ -14,7 +14,7 @@ class ProductApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(ProductsPaginatorModel( + success(ProductsPaginatorWrapper( Products$Query.fromJson(result.data).products)); } } @@ -29,7 +29,7 @@ class ProductApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(ProductsPaginatorModel( + success(ProductsPaginatorWrapper( Products$Query.fromJson(result.data).products)); } } @@ -57,7 +57,7 @@ class ProductApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(ProductsPaginatorModel( + success(ProductsPaginatorWrapper( Products$Query.fromJson(result.data).products)); } } @@ -70,7 +70,7 @@ class ProductApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(RelatedProductsModel( + success(RelatedProductsList( RelatedProducts$Query.fromJson(result.data).relatedProducts)); } } @@ -86,7 +86,7 @@ class ProductApiManager extends BaseApiManager { fail(ApiErrorHelper.handle(result)); } else { success( - RatingPaginatorModel(Ratings$Query.fromJson(result.data).ratings)); + RatingPaginatorWrapper(Ratings$Query.fromJson(result.data).ratings)); } } @@ -108,7 +108,7 @@ class ProductApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(OrderProductsModel( + success(OrderProductsWrapper( OrderProducts$Query.fromJson(result.data).products)); } } diff --git a/lib/apis/user_api_manager.dart b/lib/apis/user_api_manager.dart index 950ef21..ecc783e 100644 --- a/lib/apis/user_api_manager.dart +++ b/lib/apis/user_api_manager.dart @@ -52,7 +52,7 @@ class UserApiManager extends BaseApiManager { if (result.hasException) { fail(ApiErrorHelper.handle(result)); } else { - success(OrdersModel(Orders$Query.fromJson(result.data).orders)); + success(OrdersWrapper(Orders$Query.fromJson(result.data).orders)); } } } diff --git a/lib/common_models/common_models.dart b/lib/common_models/common_models.dart index ce041d0..7997131 100644 --- a/lib/common_models/common_models.dart +++ b/lib/common_models/common_models.dart @@ -24,20 +24,17 @@ class UserRegisterModel { class AuthPayloadLoginModel { final SignIn$Mutation$AuthPayload authPayload; - AuthPayloadLoginModel(this.authPayload); } class AuthPayloadRefreshTokenModel { final RefreshToken$Mutation$AuthPayload authPayload; - AuthPayloadRefreshTokenModel(this.authPayload); } -class AddressesModel { +class AddressesWrapper { final GetAllAddress$Query$UserAddressPaginator addressPaginator; - - AddressesModel(this.addressPaginator); + AddressesWrapper(this.addressPaginator); } class CityModel { @@ -45,9 +42,9 @@ class CityModel { CityModel(this.city); } -class CitiesModel { +class CitiesList { final List cities; - CitiesModel(this.cities); + CitiesList(this.cities); } class AreaModel { @@ -55,14 +52,14 @@ class AreaModel { AreaModel(this.area); } -class AreasModel { +class AreasList { final List areas; - AreasModel(this.areas); + AreasList(this.areas); } -class OrdersModel { +class OrdersWrapper { final Orders$Query$OrderPaginator orders; - OrdersModel(this.orders); + OrdersWrapper(this.orders); } class CartModel { @@ -80,9 +77,9 @@ class SliderModel { SliderModel(this.slider); } -class SlidersModel { +class SliderList { final List sliders; - SlidersModel(this.sliders); + SliderList(this.sliders); } class CategoryModel { @@ -90,14 +87,14 @@ class CategoryModel { CategoryModel(this.category); } -class CategoriesModel { +class CategoriesList { final List categories; - CategoriesModel(this.categories); + CategoriesList(this.categories); } -class ProductsPaginatorModel { +class ProductsPaginatorWrapper { final Products$Query$ProductPaginator productsPaginator; - ProductsPaginatorModel(this.productsPaginator); + ProductsPaginatorWrapper(this.productsPaginator); } class ProductModel { @@ -105,24 +102,24 @@ class ProductModel { ProductModel(this.productDetails); } -class RelatedProductsModel { +class RelatedProductsList { final List relatedProducts; - RelatedProductsModel(this.relatedProducts); + RelatedProductsList(this.relatedProducts); } -class RatingPaginatorModel { +class RatingPaginatorWrapper { final Ratings$Query$RatingPaginator ratingPaginator; - RatingPaginatorModel(this.ratingPaginator); + RatingPaginatorWrapper(this.ratingPaginator); } -class OrderProductsModel { +class OrderProductsWrapper { final OrderProducts$Query$ProductPaginator orderProducts; - OrderProductsModel(this.orderProducts); + OrderProductsWrapper(this.orderProducts); } -class BrandModel { +class BrandList { final List brand; - BrandModel(this.brand); + BrandList(this.brand); } class CartItemModel { diff --git a/lib/mmd_ecommerce_fl_lib.dart b/lib/mmd_ecommerce_fl_lib.dart index c5867d2..56d990a 100644 --- a/lib/mmd_ecommerce_fl_lib.dart +++ b/lib/mmd_ecommerce_fl_lib.dart @@ -32,5 +32,4 @@ class MmdECommerceFlLib { // TODO --> manage token session with the library .. // TODO --> auto refresh token with the library .. -// TODO --> use fragments for paging info .. // TODO --> connect library to directly get code from git hub ..