Apollo 所需的库是 apollo-boost,react-apollo,react-apollo-hooks,graphql-tag和graphql。 apollo-boost 包含了查询 API 和在内存中缓存数据所需的工具, react-apollo 为React提供绑定, react-apollo-hooks 在 React Hook 中包装了 1yarn add apollo-boost react-apollo react-apollo-hooks graphql-tag graphql graphql-code-generator 用于自动化 4import { ApolloProvider } from 'react-apollo'; 5import { ApolloProvider as ApolloHooksProvider } from 'react-apollo-hooks