-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from AlexTasev/feat/move-to-https-uri
feat: the api's https address is used
- Loading branch information
Showing
3 changed files
with
69 additions
and
41 deletions.
There are no files selected for viewing
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,24 @@ | ||
import { | ||
ApolloClient | ||
} from 'apollo-client'; | ||
import { | ||
InMemoryCache | ||
} from 'apollo-cache-inmemory'; | ||
import { | ||
createHttpLink | ||
} from 'apollo-link-http'; | ||
import { | ||
typeDefs | ||
} from './local'; | ||
import { ApolloClient } from 'apollo-client'; | ||
import { InMemoryCache } from 'apollo-cache-inmemory'; | ||
import { createHttpLink } from 'apollo-link-http'; | ||
import { typeDefs } from './local'; | ||
import authLink from './auth'; | ||
|
||
const httpLink = createHttpLink({ | ||
uri: 'http://softuni-swapp-212366186.eu-west-1.elb.amazonaws.com/graphql' | ||
uri: 'https://swapp.st6.io/graphql', | ||
}); | ||
|
||
const cache = new InMemoryCache(); | ||
const client = new ApolloClient({ | ||
cache, | ||
link: authLink.concat(httpLink), | ||
typeDefs | ||
}) | ||
cache, | ||
link: authLink.concat(httpLink), | ||
typeDefs, | ||
}); | ||
|
||
cache.writeData({ | ||
data: { | ||
authenticated: !!localStorage.getItem('token'), | ||
}, | ||
data: { | ||
authenticated: !!localStorage.getItem('token'), | ||
}, | ||
}); | ||
|
||
export default client; | ||
export default client; |