I didn't know if this was intended, but generated Mutation operation classes require a $__typename parameter to be provided in their constructors. Is it normal for consumers to deviate from the type name declared in the source schema? How feasible would it be for $__typename to be removed from the constructor, or made optional with a reasonable default value?
mutation Update($id: ID!) {
update(id: $id) {
id
}
}
generates the following dart code
class Mutation$Update {
Mutation$Update({
required this.update,
required this.$__typename,
});
final Mutation$Update$update update;
final String $__typename;
// ...
}
// consumer writes:
final mutation = Mutation$Update(
update: Mutation$Update$update(
id: myId,
$__typename: 'update',
),
$__typename: 'Update',
);
while the following would be more convenient
class Mutation$Update {
Mutation$Update({
required this.update,
});
final Mutation$Update$update update;
const String $__typename = 'Update';
// ...
}
// consumer writes:
final mutation = Mutation$Update(
update: Mutation$Update$update(
id: myId,
),
);
Thanks again for all your work on this library. It's been a pleasure to work with. :)
I didn't know if this was intended, but generated Mutation operation classes require a $__typename parameter to be provided in their constructors. Is it normal for consumers to deviate from the type name declared in the source schema? How feasible would it be for $__typename to be removed from the constructor, or made optional with a reasonable default value?
generates the following dart code
while the following would be more convenient
Thanks again for all your work on this library. It's been a pleasure to work with. :)