fresh_graphql 0.6.0 copy "fresh_graphql: ^0.6.0" to clipboard
fresh_graphql: ^0.6.0 copied to clipboard

An graphql link for token refresh. Built on top of package:graphql and manages authentication tokens transparently.

fresh_graphql 🍋 #

Pub fresh_graphql coverage License: MIT


A graphql link for built-in token refresh. Built to be used with fresh.

Overview #

fresh_graphql is a graphql link which attempts to simplify custom API authentication by integrating token refresh and caching transparently. fresh_graphql is flexible and is intended to support custom token refresh mechanisms.

Usage #

final freshLink = FreshLink.oAuth2(
  tokenStorage: InMemoryTokenStorage(),
  refreshToken: (token, client) {
    // Perform refresh and return new token
  },
);
final graphQLClient = GraphQLClient(
  cache: InMemoryCache(),
  link: Link.from([freshLink, HttpLink(uri: 'https://my.graphql.api')]),
);

Example #

See the example for a complete sample application using fresh_graphql which integrates with api.graphql.jobs.

32
likes
140
pub points
89%
popularity

Publisher

verified publisherfelangel.dev

An graphql link for token refresh. Built on top of package:graphql and manages authentication tokens transparently.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

fresh, gql_exec, gql_link, http

More

Packages that depend on fresh_graphql