Skip to content

Customer metafields #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
b64ca40
Create CODEOWNERS
WildForkScott May 17, 2022
fd77948
Remove availableQuantity as we do not use this variable from shopify.…
Tonylib May 18, 2022
a340b20
finish remove qty avail
Tonylib May 18, 2022
3f969d5
created method for getting metafields
komalakhani May 18, 2022
54b10d2
query parameter changes.
Viratclarion May 18, 2022
c79c7ee
id parameter removed for testing.
Viratclarion May 18, 2022
f3b4e86
id parameter added.
Viratclarion May 18, 2022
11acc8e
node added in get_customer.dart.
Viratclarion May 18, 2022
4fe73dc
Metafield changes.
Viratclarion May 18, 2022
ab38ba4
node added in get_customer.dart.
Viratclarion May 19, 2022
2a5beb3
Merge branch 'removeQtyAvailable' of https://github.com/wildfork/shop…
Viratclarion May 20, 2022
0b425e1
Merge pull request #1 from wildfork/virat_getmetafields
wildforkAnthony May 20, 2022
b4c455c
curley bracket added in metafield.
Viratclarion May 20, 2022
85449e9
s removed from nodes.
Viratclarion May 20, 2022
bdc8dbe
first limit added.
Viratclarion May 20, 2022
9cb30e4
Merge pull request #2 from wildfork/virat_getmetafields
WildForkVirat May 20, 2022
0ffa0ca
customer metafield added in return method of get metafields.
Viratclarion May 23, 2022
0d22a0e
Storefront API mutation added.
Viratclarion May 24, 2022
9d351ab
get metafield query added.
Viratclarion Jun 6, 2022
f28eb1b
Get meta field method added.
Viratclarion Jun 6, 2022
775da62
minor changes
Viratclarion Jun 7, 2022
797c01f
Minor change in query.
Viratclarion Jun 7, 2022
23c3740
Minor change in query.
Viratclarion Jun 7, 2022
5e96260
Minor change in ID.
Viratclarion Jun 7, 2022
9973c80
Minor change in query.
Viratclarion Jun 7, 2022
4c78aa1
Minor change in query.
Viratclarion Jun 7, 2022
0ca6deb
Minor change in query.
Viratclarion Jun 7, 2022
8020f0c
Minor change in query.
Viratclarion Jun 7, 2022
063aa99
Minor change in query.
Viratclarion Jun 7, 2022
e793e6b
Minor change in query.
Viratclarion Jun 7, 2022
6058cef
Minor change in query.
Viratclarion Jun 7, 2022
6f07371
Minor change in query.
Viratclarion Jun 7, 2022
7b2571d
Minor change in query.
Viratclarion Jun 7, 2022
4ed0c98
Dynamic ID added.
Viratclarion Jun 7, 2022
db1e678
Delete allow_storefront_api_access.dart
WildForkVirat Jun 7, 2022
e23e9a3
Update get_meta_field.dart
WildForkVirat Jun 7, 2022
87b31fd
Delete shopify_product.dart
WildForkVirat Jun 7, 2022
922cb1c
Merge pull request #3 from wildfork/virat_getmetafields
wildforkAnthony Jun 7, 2022
a730ff1
Last name added in customer_create.dart query.
Viratclarion Jun 10, 2022
e951cb8
Merge branch 'master' of https://github.com/wildfork/shopify-mobile-a…
Viratclarion Jun 10, 2022
8d041af
Merge pull request #4 from wildfork/virat_getmetafields
wildforkAnthony Jun 10, 2022
150a84e
- For testing
WildForkDevin Jun 30, 2022
2b10745
- Still working
WildForkDevin Jul 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# The following team is the owner for everything in the repo. Everyone in
# the team will be requested for review when someone opens a pull request.
* @wildfork/us-mobile-app
22 changes: 11 additions & 11 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
version: "1.16.0"
convert:
dependency: transitive
description:
Expand Down Expand Up @@ -119,7 +119,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.0"
ffi:
dependency: transitive
description:
Expand All @@ -145,7 +145,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.25-alpha"
version: "0.0.26-alpha"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -260,7 +260,7 @@ packages:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3"
version: "0.6.4"
json_annotation:
dependency: transitive
description:
Expand Down Expand Up @@ -295,7 +295,7 @@ packages:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
version: "0.1.4"
meta:
dependency: transitive
description:
Expand Down Expand Up @@ -323,7 +323,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
path_provider_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -468,7 +468,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.2"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -503,7 +503,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
version: "0.4.9"
typed_data:
dependency: transitive
description:
Expand Down Expand Up @@ -580,7 +580,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.2"
watcher:
dependency: transitive
description:
Expand Down Expand Up @@ -617,5 +617,5 @@ packages:
source: hosted
version: "3.1.0"
sdks:
dart: ">=2.15.0 <3.0.0"
flutter: ">=2.10.1"
dart: ">=2.17.0-0 <3.0.0"
flutter: ">=2.10.0"
1 change: 1 addition & 0 deletions lib/graphql_operations/mutations/customer_create.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ mutation MyMutation($firstName: String, $lastName: String, $email: String!, $pas
displayName
email
firstName
lastName
id
lastIncompleteCheckout {
completedAt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ query($id : ID!, $cursor : String, $sortKey: ProductCollectionSortKeys){
}
availableForSale
id
quantityAvailable
unitPrice {
amount
currencyCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ query( $cursor: String, $sortKey : ProductSortKeys, $query: String, $reverse: Bo
value
}
id
quantityAvailable
}
}
}
Expand Down
1 change: 0 additions & 1 deletion lib/graphql_operations/queries/get_collections.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ query($cursor: String, $sortKey: CollectionSortKeys, $reverse: Boolean){
value
}
availableForSale
quantityAvailable
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions lib/graphql_operations/queries/get_customer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ query($customerAccessToken : String!){
firstName
id
lastName
metafields(first:250) {
edges {
node {
id
key
namespace
value
}
}
}
lastIncompleteCheckout {
completedAt
createdAt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ query getFeaturedCollectionQuery($query: String!){
sku
requiresShipping
availableForSale
quantityAvailable
selectedOptions {
name
value
Expand Down
18 changes: 18 additions & 0 deletions lib/graphql_operations/queries/get_meta_field.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const String getMetaField = r'''
query ProductMetafields($productId : ID!){
product(id: $productId) {
metafields(namespace: "wildfox", first: 50) {
edges {
node {
id
namespace
key
value
valueType
description
}
}
}
}
}
''';
1 change: 0 additions & 1 deletion lib/graphql_operations/queries/get_n_products.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ query($n : Int, $sortKey : ProductSortKeys, $reverse: Boolean){
availableForSale
sku
requiresShipping
quantityAvailable
selectedOptions {
name
value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ query getProductRecommentationsQuery($id: ID!){
availableForSale
sku
requiresShipping
quantityAvailable
selectedOptions {
name
value
Expand Down
1 change: 0 additions & 1 deletion lib/graphql_operations/queries/get_products.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ query($cursor : String, $metafieldsNamespace : String){
availableForSale
sku
requiresShipping
quantityAvailable
selectedOptions {
name
value
Expand Down
3 changes: 1 addition & 2 deletions lib/graphql_operations/queries/get_products_by_handle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ query getProductByHandle($handle : String!){
amount
currencyCode
}
quantityAvailable
}
}
}
}
}
''';
''';
1 change: 0 additions & 1 deletion lib/graphql_operations/queries/get_products_by_ids.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ query($ids : [ID!]!){
value
}
id
quantityAvailable
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ query($cursor: String, $sortKey: CollectionSortKeys, $sortKeyProduct: ProductCol
value
}
availableForSale
quantityAvailable
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ query($cursor : String, $x : Int, $reverse: Boolean, $sortKey: ProductSortKeys){
availableForSale
sku
requiresShipping
quantityAvailable
selectedOptions {
name
value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ query($id : ID!, $cursor : String, $limit : Int, $sortKey : ProductCollectionSor
}
availableForSale
id
quantityAvailable
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ query( $cursor: String, $limit : Int, $sortKey : ProductSortKeys, $query: String
value
}
id
quantityAvailable
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/models/src/product/metafield/metafield.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Metafield with _$Metafield {
required String key,
required String value,
required String valueType,
@Default('') String description,
@Default('') String? description,
}) = _Metafield;

static Metafield fromGraphJson(Map<String, dynamic> json) {
Expand Down
18 changes: 9 additions & 9 deletions lib/models/src/product/metafield/metafield.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class _$MetafieldTearOff {
required String key,
required String value,
required String valueType,
String description = ''}) {
String? description = ''}) {
return _Metafield(
id: id,
namespace: namespace,
Expand All @@ -54,7 +54,7 @@ mixin _$Metafield {
String get key => throw _privateConstructorUsedError;
String get value => throw _privateConstructorUsedError;
String get valueType => throw _privateConstructorUsedError;
String get description => throw _privateConstructorUsedError;
String? get description => throw _privateConstructorUsedError;

Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
Expand All @@ -72,7 +72,7 @@ abstract class $MetafieldCopyWith<$Res> {
String key,
String value,
String valueType,
String description});
String? description});
}

/// @nodoc
Expand Down Expand Up @@ -116,7 +116,7 @@ class _$MetafieldCopyWithImpl<$Res> implements $MetafieldCopyWith<$Res> {
description: description == freezed
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String,
as String?,
));
}
}
Expand All @@ -133,7 +133,7 @@ abstract class _$MetafieldCopyWith<$Res> implements $MetafieldCopyWith<$Res> {
String key,
String value,
String valueType,
String description});
String? description});
}

/// @nodoc
Expand Down Expand Up @@ -178,7 +178,7 @@ class __$MetafieldCopyWithImpl<$Res> extends _$MetafieldCopyWithImpl<$Res>
description: description == freezed
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String,
as String?,
));
}
}
Expand Down Expand Up @@ -210,7 +210,7 @@ class _$_Metafield extends _Metafield {
final String valueType;
@JsonKey()
@override
final String description;
final String? description;

@override
String toString() {
Expand Down Expand Up @@ -259,7 +259,7 @@ abstract class _Metafield extends Metafield {
required String key,
required String value,
required String valueType,
String description}) = _$_Metafield;
String? description}) = _$_Metafield;
_Metafield._() : super._();

factory _Metafield.fromJson(Map<String, dynamic> json) =
Expand All @@ -276,7 +276,7 @@ abstract class _Metafield extends Metafield {
@override
String get valueType;
@override
String get description;
String? get description;
@override
@JsonKey(ignore: true)
_$MetafieldCopyWith<_Metafield> get copyWith =>
Expand Down
2 changes: 0 additions & 2 deletions lib/models/src/product/product_variant/product_variant.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class ProductVariant with _$ProductVariant {
required String sku,
required bool requiresShipping,
required String id,
required int quantityAvailable,
PriceV2? unitPrice,
UnitPriceMeasurement? unitPriceMeasurement,
List<SelectedOption>? selectedOptions,
Expand All @@ -45,7 +44,6 @@ class ProductVariant with _$ProductVariant {
sku: nodeJson['sku'],
requiresShipping: nodeJson['requiresShipping'],
id: nodeJson['id'],
quantityAvailable: nodeJson['quantityAvailable'],
unitPrice: nodeJson['unitPrice'] != null
? PriceV2.fromJson(nodeJson['unitPrice'])
: null,
Expand Down
Loading