Skip to content

Commit

Permalink
update example to 1.0.0-beta.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zth committed Jan 3, 2022
1 parent cb63893 commit 5831c2f
Show file tree
Hide file tree
Showing 23 changed files with 1,160 additions and 2,197 deletions.
20 changes: 13 additions & 7 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,16 @@
"bootstrap": "^4.3.1",
"bs-fetch": "^0.5.0",
"concurrently": "^5.0.0",
"graphql": "^14.5.8",
"graphql": "15.8.0",
"react": "18.0.0-rc.0",
"react-dom": "18.0.0-rc.0",
"react-relay": "12.0.0",
"relay-compiler": "12.0.0",
"relay-config": "12.0.0",
"relay-runtime": "12.0.0",
"rescript-relay": "0.23.0",
"react-relay": "13.0.0-rc.2",
"relay-runtime": "13.0.0-rc.2",
"rescript-relay": "1.0.0-beta.1",
"subscriptions-transport-ws": "^0.9.18"
},
"devDependencies": {
"html-webpack-plugin": "^3.2.0",
"reanalyze": "^2.17.0",
"rescript": "^9.1.2",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.9",
Expand All @@ -44,5 +41,14 @@
"resolutions": {
"react": "18.0.0-rc.0",
"react-dom": "18.0.0-rc.0"
},
"relay": {
"src": "./src",
"schema": "./schema.graphql",
"artifactDirectory": "./src/__generated__",
"language": "rescript",
"customScalars": {
"DateTime": "string"
}
}
}
6 changes: 2 additions & 4 deletions example/src/Avatar.res
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
module Fragment = %relay(
`
module Fragment = %relay(`
fragment Avatar_user on User {
avatarUrl
fullName
}
`
)
`)

@react.component
let make = (~user as userRef) => {
Expand Down
6 changes: 2 additions & 4 deletions example/src/Main.res
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,15 @@
* Whew, lots of information... But the only thing you really need to think about is that
* you _pass along fragment refs by passing the full object the fragment was spread on_.
*/
module Query = %relay(
`
module Query = %relay(`
query MainQuery {
siteStatistics {
...TopCardsDisplayer_siteStatistics
}
...RecentTickets_query
...TodoList_query
}
`
)
`)

@react.component
let make = () => {
Expand Down
10 changes: 4 additions & 6 deletions example/src/RecentTickets.res
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
module Fragment = %relay(
`
module Fragment = %relay(`
fragment RecentTickets_query on Query
@refetchable(queryName: "RecentTicketsRefetchQuery")
@argumentDefinitions(
first: { type: "Int!", defaultValue: 2 }
after: { type: "String!", defaultValue: "" }
first: { type: "Int", defaultValue: 2 }
after: { type: "String", defaultValue: "" }
) {
ticketsConnection(first: $first, after: $after)
@connection(key: "RecentTickets_ticketsConnection") {
Expand All @@ -16,8 +15,7 @@ module Fragment = %relay(
}
}
}
`
)
`)

@react.component
let make = (~query as queryRef) => {
Expand Down
14 changes: 8 additions & 6 deletions example/src/SingleTicket.res
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
module TicketFragment = %relay(
`
module TicketFragment = %relay(`
fragment SingleTicket_ticket on Ticket {
assignee {
__typename
... on User {
...Avatar_user
}
... on WorkingGroup {
...SingleTicketWorkingGroup_workingGroup
}
Expand All @@ -18,8 +15,13 @@ module TicketFragment = %relay(
trackingId
...TicketStatusBadge_ticket
}
`
)
`)

type x = option<string>

let someVariable = Some("test")

let _ = someVariable

@react.component
let make = (~ticket as ticketRef) => {
Expand Down
2 changes: 1 addition & 1 deletion example/src/SingleTicketWorkingGroup.res
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module WorkingGroupFragment = %relay(`
fragment SingleTicketWorkingGroup_workingGroup on WorkingGroup
@argumentDefinitions(includeMembers: { type: "Boolean!", defaultValue: false })
@argumentDefinitions(includeMembers: { type: "Boolean", defaultValue: false })
@refetchable(queryName: "SingleTicketWorkingGroupRefetchQuery") {
name
membersConnection @include(if: $includeMembers) {
Expand Down
6 changes: 2 additions & 4 deletions example/src/TicketStatusBadge.res
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
module Fragment = %relay(
`
module Fragment = %relay(`
fragment TicketStatusBadge_ticket on Ticket {
status
}
`
)
`)

@react.component
let make = (~ticket as ticketRef) =>
Expand Down
22 changes: 10 additions & 12 deletions example/src/__generated__/Avatar_user_graphql.res

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 31 additions & 39 deletions example/src/__generated__/MainQuery_graphql.res

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5831c2f

Please sign in to comment.