-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
4623bb0
commit 6e317d4
Showing
8 changed files
with
176 additions
and
81 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
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,34 @@ | ||
import { graphql } from "relay-runtime"; | ||
import { readFragment } from "relay-runtime/lib/store/ResolverFragments"; | ||
import { BetaMoveIsFreeResolver$key } from "./__generated__/BetaMoveIsFreeResolver.graphql"; | ||
|
||
/** | ||
* @RelayResolver | ||
* | ||
* @onType BetaMoveNode | ||
* @fieldName isFree | ||
* @rootFragment BetaMoveIsFreeResolver | ||
* | ||
* Client-side resolver for BetaMove.isFree | ||
* https://relay.dev/docs/guides/relay-resolvers/ | ||
*/ | ||
export default function betaMoveIsFreeResolver( | ||
betaMoveKey: BetaMoveIsFreeResolver$key | ||
): boolean { | ||
const betaMove = readFragment( | ||
graphql` | ||
fragment BetaMoveIsFreeResolver on BetaMoveNode { | ||
target { | ||
__typename | ||
# Needed to get relay to type __typename | ||
... on HoldNode { | ||
id | ||
} | ||
} | ||
} | ||
`, | ||
betaMoveKey | ||
); | ||
|
||
return betaMove.target.__typename !== "HoldNode"; | ||
} |
Oops, something went wrong.