mk_graphql 1.2.0
mk_graphql: ^1.2.0 copied to clipboard
A clean, modern, simplified GraphQL client for Dart & Flutter with normalized caching, composable links, and stream-based operation execution.
1.2.0 #
- Breaking:
OnRefreshCallback(used byonTokenRefreshonGraphQLClient,AuthLink, andSseLink) now receives a plainGraphQLClient(no auth link attached) instead of a rawDioLink, so refresh logic can use the typed client API (refreshClient.future(...),.stream(...)) instead of hand-rolling a raw HTTP request.
1.1.0 #
- Dynamic Pagination Variables: Added
applyVariables()andupdateVariables()toGraphQLPaginatorto dynamically update active variables (e.g. search queries, genre/status filters, sorting) on page 1 without recreating the paginator or wiping other active filter criteria. - Refetch & Pagination Reset Lifecycle:
refetch()resets_baseRequest = initialRequest, restoring page 1 and clearing active filters/search to defaults, whileloadNext()persists and accumulates items across pages. - Fine-Grained Page Tracking: Added optional
getPageandhasNextPagecallbacks toGraphQLPaginator.page(...)to allow authoritative backend pagination metadata (such asPageInfo.hasNextPage) to govern whether subsequent pages exist. ErrorPolicySupport: AddedErrorPolicy.none,ErrorPolicy.ignore, andErrorPolicy.allacross requests, client executions, copy constructors, and client defaults.- Performance & Cache Optimization: Added deterministic canonical JSON variable cache key sorting and Document AST caching.
- Documentation: Updated comprehensive guides for client requests, caching, links, and Flutter BLoC
emit.forEachpagination patterns.
1.0.1 #
- Pagination: added
GraphQLPaginatorwithoffset/page/cursorfactories, a reactivePaginationState(items,isLoading,isLoadingMore,hasMore,error), andGraphQLClient/GraphQLRequestextension methods (paginate,paginateOffset,paginatePage,paginateCursor) for building infinite lists without hand-rolled pagination state. - Added an optional
requestIdoverride onGraphQLRequest, enabling cross-instance optimistic-response coalescing (used internally byCompositeGraphQLRequest). - Repository moved into the unified
mk_graphqlmonorepo alongsidemk_graphql_generator; no API changes from the move itself.
1.0.0 #
- Initial release of
mk_graphql. - Composable Link Architecture:
AuthLinkwith automatic 401 interception, thread-safe asynchronous token refresh queuing, and token revocation hooks.DioLinkpowered by Dio with full cancellation support (CancelToken), automatic GraphQL Multipart Request spec uploads (Uploadscalar /MultipartFile), and HTTP interceptors.SseLinkfor Server-Sent Events (SSE) subscriptions with dynamic token header injection and 401 retry support.WebSocketLinkfor GraphQL over WebSockets (graphql-wsand legacy protocol).HttpLinkfor lightweight HTTP operations.BatchLinkfor batching multiple GraphQL requests into a single HTTP payload.TypenameLinkfor automatic__typenameinjection into AST selection sets.LoggerLinkfor structured console logging with customizable options.
- Client & Caching:
GraphQLClientsupporting both Future (future()) and Stream (stream()) operations.- Pluggable cache interface with built-in normalized
InMemoryCache. - Configurable fetch policies (
cacheFirst,cacheOnly,networkOnly,cacheAndNetwork,noCache). - Optimistic response support.
- Fully typed responses and exceptions (
GraphQLResponse,GraphQLException,UnAuthorizedException,RequestCancelledException).