Skip to content

Commit

Permalink
Relay modern example fixes (#4120)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
odinuge authored and timneutkens committed Apr 7, 2018
1 parent dac2f39 commit c486682
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion examples/with-relay-modern/components/BlogPosts.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const BlogPosts = props => {
<div>
<h1>Blog posts</h1>
{props.viewer.allBlogPosts.edges.map(({ node }) =>
<BlogPostPreview post={node} />
<BlogPostPreview key={node.id}post={node} />
)}
</div>
)
Expand All @@ -20,6 +20,7 @@ export default createFragmentContainer(BlogPosts, {
edges {
node {
...BlogPostPreview_post
id
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions examples/with-relay-modern/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand All @@ -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"
}
}

0 comments on commit c486682

Please sign in to comment.