Closed warrenisarobot closed 1 year ago
In Leto, when a query/mutation takes scalars for input variable substituion works fine. This function and query work: Dart function:
@Query() //Get the first of all rewards String something(Ctx ctx, String bob) { return "bob: $bob"; }
Client query:
mutation n($bob: String!){ something(bob: $bob) }
Server-side variable substitution works correctly. However, using using an input type this does not work as expected:
Dart function:
@GraphQLInput() @JsonSerializable() class BobInput { final String bob; BobInput(this.bob); factory BobInput.fromJson(Map<String, dynamic> json) => _$BobInputFromJson(json); Map<String, dynamic> toJson() => _$BobInputToJson(this); } @Query() String something(Ctx ctx, BobInput bobInput) { return "bob: ${bobInput.bob}"; }
Query:
query n($email: String!) { something(bobInput: { bob: $email }) }
This throws an exception on type coercion even when the varaible is set to a non-null value.
PR #6 addresses this
In Leto, when a query/mutation takes scalars for input variable substituion works fine. This function and query work: Dart function:
Client query:
Server-side variable substitution works correctly. However, using using an input type this does not work as expected:
Dart function:
Query:
This throws an exception on type coercion even when the varaible is set to a non-null value.
PR #6 addresses this