Pass Authorization Headers to Our Requests in React Through urql's fetchOptions

InstructorIan Jones

Share this video with your friends

Send Tweet

In this lesson, we take the authHeaders from our onegraph-auth object and pass them to urql. auth.authHeaders() is a function that returns {authorization: 'Bearer token-guid'}.

We do so by using the fetchOptions key when creating our urql client in src/index.js.