diff --git a/examples/with-relay-modern-server-express/lib/RelayProvider.js b/examples/with-relay-modern-server-express/lib/RelayProvider.js
deleted file mode 100644
index 5d02fb50..00000000
--- a/examples/with-relay-modern-server-express/lib/RelayProvider.js
+++ /dev/null
@@ -1,31 +0,0 @@
-import React from 'react'
-import PropTypes from 'prop-types'
-
-// Thank you https://github.com/robrichard
-// https://github.com/robrichard/relay-context-provider
-
-class RelayProvider extends React.Component {
- getChildContext () {
- return {
- relay: {
- environment: this.props.environment,
- variables: this.props.variables
- }
- }
- }
- render () {
- return this.props.children
- }
-}
-
-RelayProvider.childContextTypes = {
- relay: PropTypes.object.isRequired
-}
-
-RelayProvider.propTypes = {
- environment: PropTypes.object.isRequired,
- variables: PropTypes.object.isRequired,
- children: PropTypes.node
-}
-
-export default RelayProvider
diff --git a/examples/with-relay-modern-server-express/lib/withData.js b/examples/with-relay-modern-server-express/lib/withData.js
index 2cba4931..8a241d01 100644
--- a/examples/with-relay-modern-server-express/lib/withData.js
+++ b/examples/with-relay-modern-server-express/lib/withData.js
@@ -1,7 +1,6 @@
import React from 'react'
import initEnvironment from './createRelayEnvironment'
-import { fetchQuery } from 'react-relay'
-import RelayProvider from './RelayProvider'
+import { fetchQuery, ReactRelayContext } from 'react-relay'
export default (ComposedComponent, options = {}) => {
return class WithData extends React.Component {
@@ -45,9 +44,9 @@ export default (ComposedComponent, options = {}) => {
render () {
return (
-
+
-
+
)
}
}
diff --git a/examples/with-relay-modern-server-express/package.json b/examples/with-relay-modern-server-express/package.json
index f133ed65..f5c3368f 100644
--- a/examples/with-relay-modern-server-express/package.json
+++ b/examples/with-relay-modern-server-express/package.json
@@ -15,18 +15,18 @@
"dependencies": {
"dotenv": "^4.0.0",
"dotenv-webpack": "^1.5.4",
- "express-graphql": "^0.6.12",
- "graphql": "^0.13.2",
- "graphql-relay": "^0.5.5",
- "isomorphic-unfetch": "^2.0.0",
+ "express-graphql": "^0.7.1",
+ "graphql": "^14.1.1",
+ "graphql-relay": "^0.6.0",
+ "isomorphic-unfetch": "^3.0.0",
"next": "latest",
"react": "^16.7.0",
"react-dom": "^16.7.0",
- "react-relay": "^1.5.0"
+ "react-relay": "^2.0.0"
},
"devDependencies": {
- "babel-plugin-relay": "^1.4.1",
+ "babel-plugin-relay": "^2.0.0",
"graphql-cli": "^1.0.0-beta.4",
- "relay-compiler": "^1.5.0"
+ "relay-compiler": "^2.0.0"
}
}
diff --git a/examples/with-relay-modern-server-express/pages/index.js b/examples/with-relay-modern-server-express/pages/index.js
index aa94734e..899fb8e6 100644
--- a/examples/with-relay-modern-server-express/pages/index.js
+++ b/examples/with-relay-modern-server-express/pages/index.js
@@ -14,7 +14,12 @@ class Index extends Component {
}
return {
- relayVariables: { after, before, first, last }
+ relayVariables: {
+ after,
+ before,
+ first: parseInt(first, 10),
+ last: parseInt(last, 10)
+ }
}
}
diff --git a/examples/with-relay-modern/lib/RelayProvider.js b/examples/with-relay-modern/lib/RelayProvider.js
deleted file mode 100644
index 5d02fb50..00000000
--- a/examples/with-relay-modern/lib/RelayProvider.js
+++ /dev/null
@@ -1,31 +0,0 @@
-import React from 'react'
-import PropTypes from 'prop-types'
-
-// Thank you https://github.com/robrichard
-// https://github.com/robrichard/relay-context-provider
-
-class RelayProvider extends React.Component {
- getChildContext () {
- return {
- relay: {
- environment: this.props.environment,
- variables: this.props.variables
- }
- }
- }
- render () {
- return this.props.children
- }
-}
-
-RelayProvider.childContextTypes = {
- relay: PropTypes.object.isRequired
-}
-
-RelayProvider.propTypes = {
- environment: PropTypes.object.isRequired,
- variables: PropTypes.object.isRequired,
- children: PropTypes.node
-}
-
-export default RelayProvider
diff --git a/examples/with-relay-modern/lib/withData.js b/examples/with-relay-modern/lib/withData.js
index fa030e24..8691076f 100644
--- a/examples/with-relay-modern/lib/withData.js
+++ b/examples/with-relay-modern/lib/withData.js
@@ -1,7 +1,6 @@
import React from 'react'
import initEnvironment from './createRelayEnvironment'
-import { fetchQuery } from 'react-relay'
-import RelayProvider from './RelayProvider'
+import { fetchQuery, ReactRelayContext } from 'react-relay'
export default (ComposedComponent, options = {}) => {
return class WithData extends React.Component {
@@ -47,9 +46,9 @@ export default (ComposedComponent, options = {}) => {
render () {
return (
-
+
-
+
)
}
}
diff --git a/examples/with-relay-modern/package.json b/examples/with-relay-modern/package.json
index e334ca13..8a29aaef 100644
--- a/examples/with-relay-modern/package.json
+++ b/examples/with-relay-modern/package.json
@@ -15,17 +15,17 @@
"dependencies": {
"dotenv": "^4.0.0",
"dotenv-webpack": "^1.5.4",
- "graphql": "^0.13.2",
- "isomorphic-unfetch": "^2.0.0",
+ "graphql": "^14.1.1",
+ "isomorphic-unfetch": "^3.0.0",
"next": "latest",
"react": "^16.7.0",
"react-dom": "^16.7.0",
- "react-relay": "^1.5.0"
+ "react-relay": "^2.0.0"
},
"devDependencies": {
- "babel-plugin-relay": "^1.4.1",
+ "babel-plugin-relay": "^2.0.0",
"graphcool": "^1.2.1",
"graphql-cli": "^1.0.0-beta.4",
- "relay-compiler": "^1.5.0"
+ "relay-compiler": "^2.0.0"
}
}