This is a boilerplate for setting up Apollo Graphql client on the frontend. It encloses all the logic in one area and exports functions to be consumed cleanly. The example can be used in both React and Vue (although in React consider using the useQuery hook instead).
The repo also handles a simple authorisation system handled with local storage.