Skip to content

chore(api): added unit test for GraphQL custom types #4892

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

Merged
merged 2 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@

// ignore_for_file: public_member_api_docs, annotate_overrides, dead_code, dead_codepublic_member_api_docs, depend_on_referenced_packages, file_names, library_private_types_in_public_api, no_leading_underscores_for_library_prefixes, no_leading_underscores_for_local_identifiers, non_constant_identifier_names, null_check_on_nullable_type_parameter, override_on_non_overriding_member, prefer_adjacent_string_concatenation, prefer_const_constructors, prefer_if_null_operators, prefer_interpolation_to_compose_strings, slash_for_doc_comments, sort_child_properties_last, unnecessary_const, unnecessary_constructor_name, unnecessary_late, unnecessary_new, unnecessary_null_aware_assignments, unnecessary_nullable_for_final_variable_declarations, unnecessary_string_interpolations, use_build_context_synchronously

import 'ModelProvider.dart';
import 'package:amplify_core/amplify_core.dart' as amplify_core;
import 'package:collection/collection.dart';

import 'ModelProvider.dart';

/** This is an auto generated class representing the CustomTypeWithAppsyncScalarTypes type in your schema. */
class CustomTypeWithAppsyncScalarTypes {
final String? _stringValue;
Expand Down Expand Up @@ -738,14 +739,17 @@ class CustomTypeWithAppsyncScalarTypes {
.toList()
: null,
_customTypeValue = json['customTypeValue'] != null
? SimpleCustomType.fromJson(
new Map<String, dynamic>.from(json['customTypeValue']))
? json['customTypeValue']['serializedData'] != null
? SimpleCustomType.fromJson(new Map<String, dynamic>.from(
json['customTypeValue']['serializedData']))
: SimpleCustomType.fromJson(
new Map<String, dynamic>.from(json['customTypeValue']))
: null,
_listOfCustomTypeValue = json['listOfCustomTypeValue'] is List
? (json['listOfCustomTypeValue'] as List)
.where((e) => e != null)
.map((e) =>
SimpleCustomType.fromJson(new Map<String, dynamic>.from(e)))
.map((e) => SimpleCustomType.fromJson(
new Map<String, dynamic>.from(e['serializedData'] ?? e)))
.toList()
: null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@

// ignore_for_file: public_member_api_docs, annotate_overrides, dead_code, dead_codepublic_member_api_docs, depend_on_referenced_packages, file_names, library_private_types_in_public_api, no_leading_underscores_for_library_prefixes, no_leading_underscores_for_local_identifiers, non_constant_identifier_names, null_check_on_nullable_type_parameter, override_on_non_overriding_member, prefer_adjacent_string_concatenation, prefer_const_constructors, prefer_if_null_operators, prefer_interpolation_to_compose_strings, slash_for_doc_comments, sort_child_properties_last, unnecessary_const, unnecessary_constructor_name, unnecessary_late, unnecessary_new, unnecessary_null_aware_assignments, unnecessary_nullable_for_final_variable_declarations, unnecessary_string_interpolations, use_build_context_synchronously

import 'ModelProvider.dart';
import 'package:amplify_core/amplify_core.dart' as amplify_core;
import 'package:collection/collection.dart';

import 'ModelProvider.dart';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am confused where this change is coming from. Maybe dart fix? I think it is harmless though so I will not hold up the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most likely, I ran dart format . && dart fix --apply.


/** This is an auto generated class representing the ModelWithCustomType type in your schema. */
class ModelWithCustomType extends amplify_core.Model {
static const classType = const _ModelWithCustomTypeModelType();
Expand Down Expand Up @@ -152,14 +153,18 @@ class ModelWithCustomType extends amplify_core.Model {
ModelWithCustomType.fromJson(Map<String, dynamic> json)
: id = json['id'],
_customTypeValue = json['customTypeValue'] != null
? CustomTypeWithAppsyncScalarTypes.fromJson(
new Map<String, dynamic>.from(json['customTypeValue']))
? json['customTypeValue']['serializedData'] != null
? CustomTypeWithAppsyncScalarTypes.fromJson(
new Map<String, dynamic>.from(
json['customTypeValue']['serializedData']))
: CustomTypeWithAppsyncScalarTypes.fromJson(
new Map<String, dynamic>.from(json['customTypeValue']))
: null,
_listOfCustomTypeValue = json['listOfCustomTypeValue'] is List
? (json['listOfCustomTypeValue'] as List)
.where((e) => e != null)
.map((e) => CustomTypeWithAppsyncScalarTypes.fromJson(
new Map<String, dynamic>.from(e)))
new Map<String, dynamic>.from(e['serializedData'] ?? e)))
.toList()
: null,
_createdAt = json['createdAt'] != null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -738,14 +738,17 @@ class CustomTypeWithAppsyncScalarTypes {
.toList()
: null,
_customTypeValue = json['customTypeValue'] != null
? SimpleCustomType.fromJson(
new Map<String, dynamic>.from(json['customTypeValue']))
? json['customTypeValue']['serializedData'] != null
? SimpleCustomType.fromJson(new Map<String, dynamic>.from(
json['customTypeValue']['serializedData']))
: SimpleCustomType.fromJson(
new Map<String, dynamic>.from(json['customTypeValue']))
: null,
_listOfCustomTypeValue = json['listOfCustomTypeValue'] is List
? (json['listOfCustomTypeValue'] as List)
.where((e) => e != null)
.map((e) =>
SimpleCustomType.fromJson(new Map<String, dynamic>.from(e)))
.map((e) => SimpleCustomType.fromJson(
new Map<String, dynamic>.from(e['serializedData'] ?? e)))
.toList()
: null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,18 @@ class ModelWithCustomType extends amplify_core.Model {
ModelWithCustomType.fromJson(Map<String, dynamic> json)
: id = json['id'],
_customTypeValue = json['customTypeValue'] != null
? CustomTypeWithAppsyncScalarTypes.fromJson(
new Map<String, dynamic>.from(json['customTypeValue']))
? json['customTypeValue']['serializedData'] != null
? CustomTypeWithAppsyncScalarTypes.fromJson(
new Map<String, dynamic>.from(
json['customTypeValue']['serializedData']))
: CustomTypeWithAppsyncScalarTypes.fromJson(
new Map<String, dynamic>.from(json['customTypeValue']))
: null,
_listOfCustomTypeValue = json['listOfCustomTypeValue'] is List
? (json['listOfCustomTypeValue'] as List)
.where((e) => e != null)
.map((e) => CustomTypeWithAppsyncScalarTypes.fromJson(
new Map<String, dynamic>.from(e)))
new Map<String, dynamic>.from(e['serializedData'] ?? e)))
.toList()
: null,
_createdAt = json['createdAt'] != null
Expand Down
Loading