Skip to content
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

Queries assume id when it is not provided automatically for generatedQueryOptions #367

Open
reduxdj opened this issue Nov 7, 2024 · 2 comments

Comments

@reduxdj
Copy link

reduxdj commented Nov 7, 2024

type Query {
  myProfile: User
}
query FetchProfile  {
    fetchProfile: myProfile {
     id
     firstName
     lastName
    }
}

Generates:

  factory Query$FetchProfile.fromJson(Map<String, dynamic> json) {
    final l$fetchProfile = json['fetchProfile'];
    final l$$__typename = json['__typename'];
    return Query$FetchProfile(
      fetchProfile: l$fetchProfile == null
          ? null
          : Query$FetchProfile$fetchProfile.fromJson(
              (l$fetchProfile as Map<String, dynamic>)),
      $__typename: (l$$__typename as String),
    );
  }

  final Query$FetchProfile$fetchProfile? fetchProfile;

  final String $__typename;

  Map<String, dynamic> toJson() {
    final _resultData = <String, dynamic>{};
    final l$fetchProfile = fetchProfile;
    _resultData['fetchProfile'] = l$fetchProfile?.toJson();
    final l$$__typename = $__typename;
    _resultData['__typename'] = l$$__typename;
    return _resultData;
  }

  @override
  int get hashCode {
    final l$fetchProfile = fetchProfile;
    final l$$__typename = $__typename;
    return Object.hashAll([
      l$fetchProfile,
      l$$__typename,
    ]);
  }

  @override
  bool operator ==(Object other) {
    if (identical(this, other)) {
      return true;
    }
    if (!(other is Query$FetchProfile) || runtimeType != other.runtimeType) {
      return false;
    }
    final l$fetchProfile = fetchProfile;
    final lOther$fetchProfile = other.fetchProfile;
    if (l$fetchProfile != lOther$fetchProfile) {
      return false;
    }
    final l$$__typename = $__typename;
    final lOther$$__typename = other.$__typename;
    if (l$$__typename != lOther$$__typename) {
      return false;
    }
    return true;
  }
}
Copy link

github-actions bot commented Nov 7, 2024

👋 @reduxdj
Thank you for raising an issue. I will investigate the issue and get back to you as soon as possible.
Please make sure you have provided enough context.

This library is created and maintained by me, @budde377. Please consider supporting my work and ensure our survival by donating here.

@budde377
Copy link
Contributor

budde377 commented Nov 8, 2024

I have no idea what you are asking. Please elaborate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants