gql_transform_link 1.0.1-alpha+1709845491473 copy "gql_transform_link: ^1.0.1-alpha+1709845491473" to clipboard
gql_transform_link: ^1.0.1-alpha+1709845491473 copied to clipboard

GQL Link to transform Requests and Responses. May be used to update context, document, variables, data, errors, etc.

example/gql_transform_link_example.dart

import "package:gql_exec/gql_exec.dart";
import "package:gql_link/gql_link.dart";
import "package:gql_transform_link/gql_transform_link.dart";

void main() {
  // ignore: unused_local_variable
  final link = Link.from([
    // SomeLink(),
    TransformLink(
      requestTransformer: (req) => req.withContextEntry(
        RequestExtensionsThunk(
          (req2) => req2.variables,
        ),
      ),
      responseTransformer: (resp) => resp.withContextEntry(
        ResponseExtensions(
          "an extension",
        ),
      ),
    ),
    // SomeTerminatingLink(),
  ]);
}
0
likes
160
points
443k
downloads

Publisher

verified publishergql-dart.dev

Weekly Downloads

GQL Link to transform Requests and Responses. May be used to update context, document, variables, data, errors, etc.

Repository (GitHub)
View/report issues

Topics

#graphql #gql #gql-link

Documentation

API reference

License

MIT (license)

Dependencies

gql_exec, gql_link

More

Packages that depend on gql_transform_link