@8base/apollo-client 中文文档教程

发布于 3年前 浏览 25 项目主页 更新于 3年前

8base Create Apollo Client

Apollo Client 库包含 ApolloClient 的扩展实现,其中包括几个与 8base 配合使用的链接服务。

EightBaseApolloClient

Table of Contents

EightBaseApolloClient

Extends ApolloClient

通过 8base 几个链接扩展 Apollo Client。

Parameters

  • config Object The Apollo Client config.
    • config.uri string Endpoint of the GraphQl server.
    • config.getAuthState Function Used to retrieve authentication state.
    • config.getRefreshTokenParameters Function Used to retrieve the refresh token parameters.
    • config.onAuthSuccess Function Callback that is executed when an attempt to refresh authentication is successful.
    • config.onAuthError Function? Callback which is executed when an attempt to refresh authentication fails.
    • config.onIdTokenExpired Function? Callback which is executed when id token is expired.
    • config.onRequestSuccess Function? Callback which is executed when a request is successful.
    • config.onRequestError Function? Callback which is executed when a request fails
    • config.extendLinks Function? Function that extends standard array of links.

返回 Apollo Client 的任何实例

8base Create Apollo Client

The Apollo Client library contains an extended implementation of ApolloClient that includes several links to work with 8base services.

EightBaseApolloClient

Table of Contents

EightBaseApolloClient

Extends ApolloClient

Extends Apollo Client by 8base several links.

Parameters

  • config Object The Apollo Client config.
    • config.uri string Endpoint of the GraphQl server.
    • config.getAuthState Function Used to retrieve authentication state.
    • config.getRefreshTokenParameters Function Used to retrieve the refresh token parameters.
    • config.onAuthSuccess Function Callback that is executed when an attempt to refresh authentication is successful.
    • config.onAuthError Function? Callback which is executed when an attempt to refresh authentication fails.
    • config.onIdTokenExpired Function? Callback which is executed when id token is expired.
    • config.onRequestSuccess Function? Callback which is executed when a request is successful.
    • config.onRequestError Function? Callback which is executed when a request fails
    • config.extendLinks Function? Function that extends standard array of links.

Returns any instance of the Apollo Client

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文