提交 bd6e9710 编写于 作者: T Ting-Hsiang Hsu 提交者: Luis Fernando Alvarez D

(example/with-react-relay-network-modern) Fix example (#7590)

上级 204e5a71
......@@ -8,26 +8,26 @@
"build": "next build",
"start": "next start",
"relay": "relay-compiler --src ./ --exclude '**/.next/**' '**/node_modules/**' '**/test/**' '**/__generated__/**' --exclude '**/schema/**' --schema ./schema/schema.graphql",
"schema": "graphql get-schema dev"
"schema": "graphql get-schema -e dev"
},
"author": "",
"license": "ISC",
"dependencies": {
"dotenv": "^4.0.0",
"dotenv": "^8.0.0",
"dotenv-webpack": "^1.5.4",
"graphql": "^0.13.2",
"isomorphic-fetch": "2.2.1",
"graphql": "^14.3.0",
"isomorphic-fetch": "^2.2.1",
"next": "latest",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-relay": "^1.5.0",
"react-relay-network-modern": "2.4.0",
"react-relay-network-modern-ssr": "1.2.1"
"react-relay": "^5.0.0",
"react-relay-network-modern": "^4.0.0",
"react-relay-network-modern-ssr": "^1.2.2"
},
"devDependencies": {
"babel-plugin-relay": "^1.4.1",
"babel-plugin-relay": "^5.0.0",
"graphcool": "^1.2.1",
"graphql-cli": "^1.0.0-beta.4",
"relay-compiler": "^1.5.0"
"graphql-cli": "^3.0.11",
"relay-compiler": "^5.0.0"
}
}
......@@ -11,7 +11,7 @@ export default class App extends NextApp {
: {}
try {
if (initEnvironment) {
if (initEnvironment && Component.query) {
const { environment, relaySSR } = initEnvironment()
await fetchQuery(environment, Component.query, variables)
......@@ -35,7 +35,7 @@ export default class App extends NextApp {
const environment = createEnvironment(
relayData,
JSON.stringify({
queryID: Component.query ? Component.query().name : undefined,
queryID: Component.query ? Component.query().params.name : undefined,
variables
})
)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册