WIP
This commit is contained in:
@@ -40,14 +40,15 @@ export const useAuthHeader = () => {
|
||||
|
||||
export const ClientProvider: React.FC<Props> = ({ children }) => {
|
||||
const [authHeader, setAuthHeader] = useState({ key: "", value: "" });
|
||||
console.log(`The api uri is ${API_URI}`);
|
||||
const httpLink = new HttpLink({
|
||||
uri: API_URI || "https://api-dev.railbird.ai/graphql",
|
||||
uri: API_URI,
|
||||
});
|
||||
const cache = new InMemoryCache({});
|
||||
|
||||
const authMiddleware = new ApolloLink((operation, forward) => {
|
||||
const { key, value } = authHeader;
|
||||
|
||||
console.log("Auth Key", key, "Value", value);
|
||||
if (key && value) {
|
||||
operation.setContext({
|
||||
headers: {
|
||||
|
Reference in New Issue
Block a user