GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support for input fields called 'props' · Issue #418 · comigor/artemis

This repository was archived by the owner on Oct 2, 2024. It is now read-only.
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

Support for input fields called 'props' #418

Copy link
Copy link
Open
Open
Support for input fields called 'props'#418
Copy link
Labels
bugSomething isn't working

Description

@anlumo
anlumo
opened on Oct 3, 2023
Issue body actions

Bug description

In my service's schema, there's a type like this:

input Update {
	id: UUID!
	name: String
	props: MyProps
}

This gets translated to this Dart code:

@JsonSerializable(explicitToJson: true)
class Update extends JsonSerializable with EquatableMixin {
  Update({
    required this.id,
    this.name,
    this.props,
  });

  factory Update.fromJson(Map<String, dynamic> json) =>
      _$UpdateFromJson(json);

  @JsonKey(
      fromJson: fromGraphQLUuidToDartString,
      toJson: fromDartStringToGraphQLUuid)
  late String id;

  String? name;

  @JsonKey(
      fromJson: fromGraphQLMyPropsNullableToDartMyPropsNullable,
      toJson: fromDartMyPropsNullableToGraphQLMyPropsNullable)
  MyProps? props;

  @override
  List<Object?> get props =>
      [id, name, props];
  @override
  Map<String, dynamic> toJson() => _$UpdateToJson(this);
}

This doesn't compile, because there's both a field props and a getter props.

Specs

Artemis version: 7.13.0-beta.2

build.yaml:
targets:
  $default:
    builders:
      artemis:
        options:
          schema_mapping:
            - schema: lib/modules/graphql/schema.graphql
              queries_glob: lib/modules/graphql/queries/*.graphql
              output: lib/modules/graphql/models/graphql_api.dart
              naming_scheme: pathedWithFields
          scalar_mapping:
            - graphql_type: UUID
              custom_parser_import: "package:myproject/modules/graphql/scalars/uuid_scalar.dart"
              dart_type: String
            - graphql_type: MyProps
              custom_parser_import: "package:myproject/modules/graphql/scalars/my_props_scalar.dart"
              dart_type: MyProps
              use_custom_parser: true
    sources:
      - $package$
      - lib/**
      - pubspec.yaml
Details

Activity

  1. anlumo
    added
    bugSomething isn't working
    on Oct 3, 2023
  2. anlumo
    changed the title [-]Support for struct fields called 'props'[/-] [+]Support for input fields called 'props'[/+] on Oct 3, 2023
  3. vasilich6107 commented on Oct 31, 2023

    @vasilich6107
    vasilich6107
    on Oct 31, 2023
    Contributor
    More actions

    This package is not nainatined anymore)

  4. vasilich6107 commented on Oct 31, 2023

    @vasilich6107
    vasilich6107
    on Oct 31, 2023
    Contributor
    More actions

    @comigor it will be nice to archive this package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.