Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design2
/
2015104215
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
jaehyuk-jang
2021-06-09 03:06:45 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
32c0e39c2ecfae2d44a53729b58b368df9570e76
32c0e39c
1 parent
2b32aa9a
Add env setting
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
project/packages/web/lib/apollo.ts
project/packages/web/next.config.js
project/packages/web/lib/apollo.ts
View file @
32c0e39
...
...
@@ -2,8 +2,10 @@ import { useMemo } from "react";
import
{
ApolloClient
,
HttpLink
,
InMemoryCache
}
from
"@apollo/client"
;
import
{
concatPagination
}
from
"@apollo/client/utilities"
;
import
merge
from
"deepmerge"
;
export
const
APOLLO_STATE_PROP_NAME
=
"__APOLLO_STATE__"
;
import
getConfig
from
"next/config"
;
const
{
publicRuntimeConfig
}
=
getConfig
();
let
apolloClient
:
any
;
...
...
@@ -11,7 +13,7 @@ function createApolloClient() {
return
new
ApolloClient
({
ssrMode
:
typeof
window
===
"undefined"
,
link
:
new
HttpLink
({
uri
:
"http://localhost:5000/graphql"
,
// Server URL (must be absolute)
uri
:
publicRuntimeConfig
.
BACKEND_HOST
??
"http://localhost:5000/graphql"
,
// Server URL (must be absolute)
credentials
:
"same-origin"
,
// Additional fetch() options like `credentials` or `headers`
}),
cache
:
new
InMemoryCache
({
...
...
project/packages/web/next.config.js
View file @
32c0e39
...
...
@@ -20,4 +20,7 @@ module.exports = {
return
config
},
publicRuntimeConfig
:
{
BACKEND_HOST
:
process
.
env
.
BACKEND_HOST
,
}
}
...
...
Please
register
or
login
to post a comment