forked from facebook/relay
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
507 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
type t = {name: string} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* @RelayResolver UserMeta | ||
* @weak | ||
*/ | ||
type userMeta = { | ||
name: string, | ||
age: int, | ||
} | ||
|
||
/** | ||
* @RelayResolver LocalUser | ||
*/ | ||
let localUser = dataId => { | ||
UserService.getById(dataId) | ||
} | ||
|
||
/** | ||
* @RelayResolver Query.time(now: Boolean): String | ||
*/ | ||
let time = () => "hello" | ||
|
||
/** | ||
* @RelayResolver LocalUser.bestFriend(from: Timestamp): LocalUser | ||
*/ | ||
let bestFriend = () => "hello" | ||
|
||
/** | ||
* @RelayResolver UserMeta.greeting(show: Boolean!): String | ||
*/ | ||
let greeting = () => "hello" | ||
|
||
/** | ||
* @RelayResolver User.meta(status: OnlineStatus!): UserMeta | ||
*/ | ||
let meta = () => "hello" | ||
|
||
/** | ||
* @RelayResolver LocalUser.favoriteColors: [String!] | ||
*/ | ||
let favoriteColors = user => { | ||
[] | ||
} | ||
|
||
/** | ||
* @RelayResolver User.friendCount: Int | ||
* @live | ||
*/ | ||
let friendCount = user => { | ||
1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
module Query = %relay(` | ||
query TestQuery($status: OnlineStatus) { | ||
time | ||
users(status: $status) { | ||
edges { | ||
node { | ||
|
64 changes: 64 additions & 0 deletions
64
compiler/test-project-res/src/__generated__/LocalUser____relay_model_instance_graphql.res
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
compiler/test-project-res/src/__generated__/LocalUser__id_graphql.res
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
compiler/test-project-res/src/__generated__/LocalUser_relayResolvers_graphql.res
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
compiler/test-project-res/src/__generated__/Query_relayResolvers_graphql.res
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.