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

发布于 3年前 浏览 25 更新于 3年前

8base Apollo Provider

这是 Apollo Provider 下的包装器,在启动应用程序时获取 8base 联合和接口。

ApolloProvider

Table of Contents

ApolloProvider

扩展 PureComponent

提供程序获取接口片段模式并创建 apollo 客户端

Properties

  • children (React$Node | Function) Children of the provider. Could be either react node or function with loading state.
  • uri string Children 8base endpoint
  • getClient Function 8base endpoint

Usage

  import { createApolloClient, createApolloLinks } from '@8base/create-apollo-client';
  import { ApolloProvider } from '@8base/apollo-provider';

  const getClient: Function = createApolloClient({
    links: createApolloLinks({ getAuthState, uri }),
  });

  <ApolloProvider 
    getClient={ getClient }
    uri={ uri }
  >
    { ({ isLoading }) => children }
  </ApolloProvider>

8base Apollo Provider

This is wrapper under the Apollo Provider with fetching 8base unions and interfaces. on start application.

ApolloProvider

Table of Contents

ApolloProvider

Extends PureComponent

Provider fetch interfaces fragments schema and create apollo client

Properties

  • children (React$Node | Function) Children of the provider. Could be either react node or function with loading state.
  • uri string Children 8base endpoint
  • getClient Function 8base endpoint

Usage

  import { createApolloClient, createApolloLinks } from '@8base/create-apollo-client';
  import { ApolloProvider } from '@8base/apollo-provider';

  const getClient: Function = createApolloClient({
    links: createApolloLinks({ getAuthState, uri }),
  });

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