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

Nullsafe gql, gql_exec, gql_link #193

Closed
wants to merge 42 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
bb7e93a
cats: null safety
micimize Feb 10, 2021
cbcf939
gql: null safety
micimize Feb 10, 2021
fa1edbb
applied quick fixes to ast.dart
micimize Feb 13, 2021
924352d
more suggestions and quickfixes
micimize Feb 13, 2021
a6805a8
suggestions and quickfixes for printer
micimize Feb 13, 2021
cb7349a
changed _peek(TokenKind.name) != null to _peek(TokenKind.name) in _pa…
micimize Feb 13, 2021
ff71970
fix lexer digit parsing
micimize Feb 13, 2021
691e0e3
fix gql pubspec
micimize Feb 13, 2021
848c74e
gql_exec dart migrate to nullsafety
micimize Feb 13, 2021
cf4e4a2
gql_exec dart migrate to nullsafety
micimize Feb 13, 2021
c1289f0
gql_link dart migrate to nullsafety
micimize Feb 13, 2021
b5e9b39
try and resolve issues for gql_exec and gql_link at least
micimize Feb 13, 2021
99a334d
depend on 2.12-beta for CI
micimize Feb 13, 2021
ee974f4
fix formatting of gql tests
micimize Feb 13, 2021
429d717
fix some lints in gql_link
micimize Feb 13, 2021
ffc032f
fix cats pubspec
micimize Feb 13, 2021
f9c9bb5
prefer const literals
micimize Feb 13, 2021
dd93c03
remove second gql_link from workflow
micimize Feb 13, 2021
118ad83
automatic migration
micimize Feb 14, 2021
8edfa3c
nullable parsedResponse
micimize Feb 14, 2021
da8fc71
nullable parsedResponse
micimize Feb 14, 2021
5aa8bb3
mockito migration for gql_http_link
micimize Feb 14, 2021
b792c30
mockito omck generation and test fixes
micimize Feb 14, 2021
64092c9
finally got tests to pass with generated mockito types
micimize Feb 14, 2021
72259a5
testing CI
micimize Feb 14, 2021
523465a
CI analysis issue
micimize Feb 14, 2021
0f1edb7
check only if no diff
micimize Feb 14, 2021
cf46960
hard override
micimize Feb 14, 2021
d50fadf
loosen gql_http_link build_runner constraint
micimize Feb 14, 2021
d0d08dc
attempt bumping build runner and analyzer
micimize Feb 14, 2021
e24bfc5
bump built value
micimize Feb 14, 2021
7874187
bump built value
micimize Feb 14, 2021
a7f17bc
bump built collectoi
micimize Feb 14, 2021
cdb37c5
ignore mockito build failure
micimize Feb 14, 2021
c880990
build runner as separate step
micimize Feb 14, 2021
3a2cb9f
gql_example_http_auth_link: bump http version
micimize Feb 14, 2021
03701f6
migrate dedupe_link
micimize Feb 15, 2021
0c055c0
cleanup unneeded mocklink codegen
micimize Feb 15, 2021
3617102
migrate transform link
micimize Feb 15, 2021
ddd20b2
migrate error link
micimize Feb 15, 2021
6885e14
move gql_example_http_auth_link to examples, add other examples
micimize Feb 15, 2021
756a08d
ignore lack of build runners in examples
micimize Feb 15, 2021
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
Prev Previous commit
Next Next commit
migrate transform link
micimize committed Feb 15, 2021
commit 3617102ca5eef8ba471ef98b31ff49c9556259b7
12 changes: 6 additions & 6 deletions links/gql_transform_link/lib/gql_transform_link.dart
Original file line number Diff line number Diff line change
@@ -11,8 +11,8 @@ typedef ResponseTransformer = Response Function(Response response);

/// A [Link] to transform [Request]s and [Response]s
class TransformLink extends Link {
final RequestTransformer requestTransformer;
final ResponseTransformer responseTransformer;
final RequestTransformer? requestTransformer;
final ResponseTransformer? responseTransformer;

TransformLink({
this.requestTransformer,
@@ -22,15 +22,15 @@ class TransformLink extends Link {
@override
Stream<Response> request(
Request request, [
NextLink forward,
NextLink? forward,
]) {
final req =
requestTransformer != null ? requestTransformer(request) : request;
requestTransformer != null ? requestTransformer!(request) : request;

if (responseTransformer == null) {
return forward(req);
return forward!(req);
}

return forward(req).map(responseTransformer);
return forward!(req).map(responseTransformer!);
}
}
6 changes: 3 additions & 3 deletions links/gql_transform_link/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -3,12 +3,12 @@ version: 0.1.5
description: GQL Link to transform Requests and Responses. May be used to update context, document, variables, data, errors, etc.
repository: https://github.com/gql-dart/gql
environment:
sdk: '>=2.7.2 <3.0.0'
sdk: '>=2.12.0-259.12.beta <3.0.0'
dependencies:
gql_exec: ^0.2.5
gql_link: ^0.3.1
dev_dependencies:
test: ^1.0.0
mockito: ^4.1.1
test: ^1.16.2
mockito: ^5.0.0-nullsafety.7
gql: ^0.12.3
gql_pedantic: ^1.0.2
11 changes: 10 additions & 1 deletion links/gql_transform_link/test/gql_transform_link_test.dart
Original file line number Diff line number Diff line change
@@ -7,7 +7,16 @@ import "package:gql_transform_link/gql_transform_link.dart";
import "package:mockito/mockito.dart";
import "package:test/test.dart";

class MockLink extends Mock implements Link {}
class MockLink extends Mock implements Link {
@override
Stream<Response> request(Request? request, [NextLink? forward]) =>
super.noSuchMethod(
Invocation.method(#request, [request, forward]),
returnValue: Stream.fromIterable(
<Response>[],
),
) as Stream<Response>;
}

void main() {
group("Transform Link", () {