Send manually request to GraphQL

2019-08-16 07:56发布

I want to send manually requests to a graphql server using Apollo,

Actually Im wrapping my App in an ApolloProvider and the requests are send each time I render my component. Here is the code of my component :

export default graphql(gql`
  query Hello{
        hello
        }
  `)(myComponent);

How may I send the graphql requests manually without passing by the component rendering (handled by buttons clicks for example).

1条回答
仙女界的扛把子
2楼-- · 2019-08-16 08:08

You can use apollo-fetch to run standalone graphql queries that integrate with your Apollo store.

查看更多
登录 后发表回答