Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
af7d021d
Commit
af7d021d
authored
Sep 10, 2019
by
Diogo Dutra
Committed by
Tim Neutkens
Sep 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix relay modern server express example (#8683)
parent
8444c1ff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
1 deletion
+4
-1
db.js
examples/with-relay-modern-server-express/server/db.js
+1
-0
rootValue.js
...ples/with-relay-modern-server-express/server/rootValue.js
+1
-0
schema.graphql
...es/with-relay-modern-server-express/server/schema.graphql
+2
-1
No files found.
examples/with-relay-modern-server-express/server/db.js
View file @
af7d021d
module
.
exports
=
{
module
.
exports
=
{
id
:
'viewer'
,
blogPosts
:
[
blogPosts
:
[
{
{
id
:
'p1'
,
id
:
'p1'
,
...
...
examples/with-relay-modern-server-express/server/rootValue.js
View file @
af7d021d
const
gqr
=
require
(
'graphql-relay'
)
const
gqr
=
require
(
'graphql-relay'
)
const
db
=
require
(
'./db'
)
const
db
=
require
(
'./db'
)
const
viewer
=
variables
=>
({
const
viewer
=
variables
=>
({
id
:
db
.
id
,
allBlogPosts
:
gqr
.
connectionFromArray
(
db
.
blogPosts
,
variables
)
allBlogPosts
:
gqr
.
connectionFromArray
(
db
.
blogPosts
,
variables
)
})
})
...
...
examples/with-relay-modern-server-express/server/schema.graphql
View file @
af7d021d
...
@@ -3,7 +3,8 @@ type Query {
...
@@ -3,7 +3,8 @@ type Query {
node
(
id
:
ID
!):
Node
node
(
id
:
ID
!):
Node
}
}
type
Viewer
{
type
Viewer
implements
Node
{
id
:
ID
!
allBlogPosts
(
after
:
String
,
before
:
String
,
first
:
Int
,
last
:
Int
):
BlogPostConnection
!
allBlogPosts
(
after
:
String
,
before
:
String
,
first
:
Int
,
last
:
Int
):
BlogPostConnection
!
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment