Skip to content
Open
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e3bfb66
add typescript support to issue-tracker
renanmav Nov 12, 2019
ec59071
revert prettier config
renanmav Nov 13, 2019
02ae738
replace non-null assertions for optional chaining on Root
renanmav Nov 13, 2019
a8424c6
throw if router doesnt exists on Link and remove unnecessary chaining…
renanmav Nov 13, 2019
f694d38
move RouteComponentProps to RouteRenderer
renanmav Nov 13, 2019
9abf9fb
avoid braceless
renanmav Nov 13, 2019
32c099d
update comment about @ts-ignore on RelayEnvironment.ts
renanmav Nov 13, 2019
bdb47e0
make Resource more precise
renanmav Nov 13, 2019
97007ce
revert IssueListItem to IssuesListItem
renanmav Nov 13, 2019
e2098e2
revert README changes
renanmav Nov 13, 2019
2c6a186
revert more README changes
renanmav Nov 13, 2019
d8411c5
revert e to event on IssueActions
renanmav Nov 13, 2019
0285f0f
force rename of GitHub
renanmav Nov 14, 2019
dd2786c
return Suspense with null fallback inside SuspenseList
renanmav Nov 14, 2019
4988da4
rename fragment IssueListItem to IssuesListItem
renanmav Nov 15, 2019
927e2eb
make result either T of obj with default
renanmav Nov 15, 2019
f6547ee
revert disable button on IssueActions
renanmav Nov 15, 2019
706cd71
revert the arrow function on Root
renanmav Nov 15, 2019
ab0b7ea
revert concat on RouteRenderer
renanmav Nov 15, 2019
58e89a3
make prepare a mandatory function
renanmav Nov 15, 2019
263a82e
use FetchFunction instead of typing function args
renanmav Nov 15, 2019
6807f0c
throw this.load() func on read() JSResource
renanmav Nov 15, 2019
da5ec35
remove optional chaining
renanmav Nov 15, 2019
a0d4660
throw if there isnt a router on RouteRenderer
renanmav Nov 18, 2019
d621941
remove unnecessary assertions on router
renanmav Nov 18, 2019
871bdca
add type guardian on JSResource
renanmav Nov 18, 2019
6836fbd
make RouteConfig entry general
renanmav Nov 19, 2019
af5b394
revert changes on README
renanmav Nov 19, 2019
7ddec0c
revert changes on README
renanmav Nov 19, 2019
01baff6
use React.FC
renanmav Nov 19, 2019
79e1a5e
add macro config to avoid false positive errors on yarn start
renanmav Nov 19, 2019
aa5def7
make all react components as React.FC
renanmav Nov 20, 2019
7cd9538
Merge branch 'master' into feat/issue-tracker-ts
renanmav Nov 20, 2019
cc1c367
Update README.md
renanmav Nov 20, 2019
5ba1807
Update .prettierrc
renanmav Nov 20, 2019
71ce2bf
remove unnecessary children prop
renanmav Nov 20, 2019
3d8ba57
Merge branch 'feat/issue-tracker-ts' of github.com:renanmav/relay-exa…
renanmav Nov 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use FetchFunction instead of typing function args
  • Loading branch information
renanmav committed Nov 15, 2019
commit 263a82e457fc7989bbfc792bbc579d191ada35a6
12 changes: 3 additions & 9 deletions issue-tracker/src/RelayEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,15 @@ import {
Network,
RecordSource,
Store,
RequestParameters,
Variables,
CacheConfig,
FetchFunction,
} from 'relay-runtime';

/**
* Relay requires developers to configure a "fetch" function that tells Relay how to load
* the results of GraphQL queries from your server (or other data source). See more at
* https://relay.dev/docs/en/quick-start-guide#relay-environment.
*/
async function fetchRelay(
params: RequestParameters,
variables: Variables,
_cacheConfig: CacheConfig,
) {
const fetchRelay: FetchFunction = async (params, variables, _cacheConfig) => {
// Check that the auth token is configured
const REACT_APP_GITHUB_AUTH_TOKEN = process.env.REACT_APP_GITHUB_AUTH_TOKEN;
if (REACT_APP_GITHUB_AUTH_TOKEN == null) {
Expand Down Expand Up @@ -58,7 +52,7 @@ async function fetchRelay(

// Otherwise, return the full payload.
return json;
}
};

export default new Environment({
network: Network.create(fetchRelay),
Expand Down