We should explore creating a client generator that simply wraps a TypedLink and provides typed access to all operations.
Rather than instantiating an operation request and manually executing it on a TypedLink, we could generate the client (based on operations in .graphql files) then execute the operations as method calls directly on the client. For example:
import 'path/to/generated/client';
final client = Client(typedLink: someLink);
Then we could execute operations:
final todos = await client.query.getTodos((b) => b..vars.offset = 10).first;
Or access the cache:
final myTodo = await client.readFragment.Todo((b) => b.id = "123");
We should explore creating a client generator that simply wraps a TypedLink and provides typed access to all operations.
Rather than instantiating an operation request and manually executing it on a TypedLink, we could generate the client (based on operations in
.graphql
files) then execute the operations as method calls directly on the client. For example:Then we could execute operations:
Or access the cache: