-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new take on resolvers using fragments
- Loading branch information
Showing
17 changed files
with
240 additions
and
36 deletions.
There are no files selected for viewing
Submodule relay
updated
5 files
17 changes: 17 additions & 0 deletions
17
packages/rescript-relay/__tests__/TestRelayUserResolver2.res
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,17 @@ | ||
module Fragment = %relay(` | ||
fragment TestRelayUserResolver2 on User { | ||
firstName | ||
lastName | ||
} | ||
`) | ||
|
||
/** | ||
* @RelayResolver User.fullName2(maxLength: Int!): String | ||
* @rootFragment TestRelayUserResolver2 | ||
* | ||
* A users full name 2. | ||
*/ | ||
let fullName2 = (user, args) => { | ||
let user = Fragment.readResolverFragment(user) | ||
`${user.firstName} ${user.lastName}`->Js.String2.slice(~from=0, ~to_=args.maxLength) | ||
} |
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
67 changes: 42 additions & 25 deletions
67
packages/rescript-relay/__tests__/__generated__/TestRelayResolversQuery_graphql.res
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
25 changes: 23 additions & 2 deletions
25
packages/rescript-relay/__tests__/__generated__/TestRelayResolvers_user_graphql.res
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
68 changes: 68 additions & 0 deletions
68
packages/rescript-relay/__tests__/__generated__/TestRelayUserResolver2_graphql.res
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 6 additions & 1 deletion
7
packages/rescript-relay/__tests__/__generated__/User_relayResolvers_graphql.res
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.