File tree Expand file tree Collapse file tree 3 files changed +33
-37
lines changed
relay-modern-starter-kit/src Expand file tree Collapse file tree 3 files changed +33
-37
lines changed Original file line number Diff line number Diff line change @@ -13,12 +13,11 @@ ReactDOM.render(
13
13
< QueryRenderer
14
14
environment = { environment }
15
15
query = { graphql `
16
- query appQuery($count: Int!, $cursor: String) {
17
- viewer {
18
- ...user_viewer
19
- }
20
- }
21
- ` }
16
+ query appQuery($count: Int!, $cursor: String) {
17
+ viewer {
18
+ ...user_viewer
19
+ }
20
+ }` }
22
21
variables = { { cursor : null , count : 1 } }
23
22
render = { ( { error, props } ) => {
24
23
if ( error ) { console . log ( error . source ) ; return < div > { error . message } </ div > }
Original file line number Diff line number Diff line change @@ -36,26 +36,25 @@ export default createPaginationContainer(
36
36
UserComponent ,
37
37
{
38
38
viewer : graphql `
39
- fragment user_viewer on User {
40
- widgets(
41
- first: $count
42
- after: $cursor
43
- ) @connection(key: "User_widgets") {
44
- pageInfo {
45
- hasNextPage
46
- hasPreviousPage
47
- startCursor
48
- endCursor
49
- }
50
- edges {
51
- node {
52
- id,
53
- name
54
- }
55
- }
39
+ fragment user_viewer on User {
40
+ widgets(
41
+ first: $count
42
+ after: $cursor
43
+ ) @connection(key: "User_widgets") {
44
+ pageInfo {
45
+ hasNextPage
46
+ hasPreviousPage
47
+ startCursor
48
+ endCursor
56
49
}
50
+ edges {
51
+ node {
52
+ id,
53
+ name
57
54
}
58
- ` ,
55
+ }
56
+ }
57
+ }` ,
59
58
} ,
60
59
{
61
60
direction : 'forward' ,
@@ -75,15 +74,13 @@ export default createPaginationContainer(
75
74
} ;
76
75
} ,
77
76
query : graphql `
78
- query userPaginationQuery(
79
- $count: Int!
80
- $cursor: String
81
- ) {
82
- viewer {
83
- # You could reference the fragment defined previously.
84
- ...user_viewer
85
- }
86
- }
87
- `
88
- }
77
+ query userPaginationQuery(
78
+ $count: Int!
79
+ $cursor: String
80
+ ) {
81
+ viewer {
82
+ # You could reference the fragment defined previously.
83
+ ...user_viewer
84
+ }
85
+ }` }
89
86
) ;
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ namespace FSharp.Data.GraphQL.Samples.StarWarsApi
2
2
3
3
open FSharp.Data .GraphQL
4
4
open FSharp.Data .GraphQL .Types
5
- open FSharp.Data .GraphQL .Server .Middleware
6
5
open FSharp.Data .GraphQL .Relay
6
+ open FSharp.Data .GraphQL .Server .Middleware
7
7
8
8
#nowarn " 40"
9
9
@@ -160,7 +160,7 @@ module Schema =
160
160
| None ->
161
161
human.Friends |> List.take n,
162
162
n < totalCount
163
- | _ -> failwithf " Cursor %A is not ' Friend' global id" after
163
+ | _ -> failwithf " Cursor %A is not a Friend's global id" after
164
164
| _ -> human.Friends, false
165
165
let edges = friends |> Seq.map ( fun b -> { Cursor = toGlobalId " Friend" ( string b); Node = b }) |> Seq.toList
166
166
let headCursor = edges |> List.tryHead |> Option.map ( fun edge -> edge.Cursor)
You can’t perform that action at this time.
0 commit comments