backederrorlink 0.0.2 copy "backederrorlink: ^0.0.2" to clipboard
backederrorlink: ^0.0.2 copied to clipboard

A BackendErrorLink for graphql_flutter.

backederrorlink #

BackendErrorLink for graphql_flutter

Getting Started #

final BackendErrorLink backendErrorLink = BackendErrorLink(
    onUnauthorized: (FetchResult result, StreamedResponse response) {
    expect(new Future.value(response.statusCode), completion(equals(401)));
});

final HttpLink httpLink = HttpLink(
    uri:
        'https://requestloggerbin.herokuapp.com/bin/2c0b451d-b679-4d5b-8687-0d891bead416/view');

final Link link = backendErrorLink.concat(httpLink as Link);

GraphQLClient graphQLClient = GraphQLClient(
    cache: OptimisticCache(
    dataIdFromObject: typenameDataIdFromObject,
    ),
    link: link,
);

await graphQLClient.query(QueryOptions(
    document: '''
    {
        user {
        user
        }
    }
    ''',
));
0
likes
10
pub points
0%
popularity

Publisher

unverified uploader

A BackendErrorLink for graphql_flutter.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, graphql, graphql_flutter, http

More

Packages that depend on backederrorlink