useWellPlayed
TheuseWellPlayed hook provides access to the WellPlayed context, including the organization ID, GraphQL API client, typed client, and the current access token.
Returns
The organization ID configured in the
WellPlayedProvider.The Apollo GraphQL client configured for the WellPlayed API. Use this for making GraphQL queries and mutations.
The typed client for making type-safe API requests to the WellPlayed API.
The current OIDC access token, if the user is authenticated. Returns
undefined if not authenticated.Usage Example
Error Handling
This hook will throw an error if used outside of aWellPlayedProvider:
WellPlayedProvider before using this hook.
Type Definition
Related
- WellPlayedProvider - The provider component that must wrap your app