How to use the @apollo/react-hoc.withApollo function in @apollo/react-hoc

To help you get started, we’ve selected a few @apollo/react-hoc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nilshartmann / graphql-examples / java / beeradvisor_graphql-java-dataloader / frontend-hooks / src / AuthContext.tsx View on Github external
render() {
    return (
      
        {this.props.children}
      
    );
  }
}

const AuthProviderWithGraphQL = withApollo<{}>(AuthProvider);

function useAuthContext() {
  const authContext = React.useContext(AuthContext);
  return authContext;
}

export { AuthProviderWithGraphQL as AuthProvider, useAuthContext, setAuthToken, getAuthToken };

@apollo/react-hoc

React Apollo `graphql` higher-order component.

MIT
Latest version published 4 years ago

Package Health Score

64 / 100
Full package analysis