From c486682b44ba74069fcf8ea809fbcdb3ab1dce53 Mon Sep 17 00:00:00 2001 From: Odin Ugedal Date: Sat, 7 Apr 2018 12:41:26 +0200 Subject: [PATCH] Relay modern example fixes (#4120) * Fix with-relay-modern example Starting with react-relay 1.5.0 the schema canno't be in the same dir as the src. This can be fixed by excluding the schema dir. Globs should also be inside quotation marks, to avoid non-deterministic behavior of different shells. * Add missing key on BlogPosts --- examples/with-relay-modern/components/BlogPosts.js | 3 ++- examples/with-relay-modern/package.json | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/with-relay-modern/components/BlogPosts.js b/examples/with-relay-modern/components/BlogPosts.js index 780224c969574..0d1f54e5cdea8 100644 --- a/examples/with-relay-modern/components/BlogPosts.js +++ b/examples/with-relay-modern/components/BlogPosts.js @@ -7,7 +7,7 @@ const BlogPosts = props => {

Blog posts

{props.viewer.allBlogPosts.edges.map(({ node }) => - + )}
) @@ -20,6 +20,7 @@ export default createFragmentContainer(BlogPosts, { edges { node { ...BlogPostPreview_post + id } } } diff --git a/examples/with-relay-modern/package.json b/examples/with-relay-modern/package.json index 5f56d608ef108..d7be3b935deb9 100644 --- a/examples/with-relay-modern/package.json +++ b/examples/with-relay-modern/package.json @@ -7,7 +7,7 @@ "dev": "next", "build": "next build", "start": "next start", - "relay": "relay-compiler --src ./ --exclude **/.next/** **/node_modules/** **/test/** **/__generated__/** --schema ./schema/schema.graphql", + "relay": "relay-compiler --src ./ --exclude '**/.next/**' '**/node_modules/**' '**/test/**' '**/__generated__/**' --exclude './schema/**' --schema ./schema/schema.graphql", "schema": "graphql get-schema dev" }, "author": "", @@ -19,12 +19,12 @@ "next": "latest", "react": "^16.2.0", "react-dom": "^16.2.0", - "react-relay": "^1.4.1" + "react-relay": "^1.5.0" }, "devDependencies": { - "graphql-cli": "^1.0.0-beta.4", "babel-plugin-relay": "^1.4.1", "graphcool": "^1.2.1", - "relay-compiler": "^1.4.1" + "graphql-cli": "^1.0.0-beta.4", + "relay-compiler": "^1.5.0" } }