Mohamed Taboubi
Mohamed Taboubi

Reputation: 7031

Send manually request to GraphQL

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).

Upvotes: 0

Views: 173

Answers (1)

brietsparks
brietsparks

Reputation: 5016

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

Upvotes: 1

Related Questions