Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
ids
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyBanks committed Feb 21, 2020
1 parent be2384c commit e03ab0b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ for convenience if I want to put up a branch at a memorable URL.
An Action attempts to publish a `-dev` prerelease of this package for every
green commit on `master`, and then promotes it to `prod` if successful.

The backend is published to as
The backend is published as
[`speedruns` on crates.io](https://crates.io/crates/speedruns).

The frontend is published as
[`speedruns` on NPM](https://www.npmjs.com/package/speedruns) and as
[`@jeremybanks/speedruns` on NPM](https://www.npmjs.com/package/speedruns), and
[`@jeremybanks/speedruns` on NPM](https://www.npmjs.com/package/@jeremybanks/speedruns), and
[on the GitHub Package Registry](https://github.com/jeremyBanks/speedruns/packages/120812).
2 changes: 1 addition & 1 deletion src/components/hooks/with-apollo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const getApolloClient = (
cache.restore(initialState);
}

const policy = DEBUG ? "cache-and-network" : "cache-first";
const policy = "cache-first";

globalApolloClient = new ApolloClient({
cache,
Expand Down
8 changes: 8 additions & 0 deletions src/components/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

export interface GetGamePagePreview_game {
__typename: "Game";
/**
* GraphQL node ID
*/
id: string;
/**
* URL slug used on speedrun.com
*/
Expand Down Expand Up @@ -1106,6 +1110,10 @@ export interface GetHomeStats {

export interface GetGameIndex_games {
__typename: "Game";
/**
* GraphQL node ID
*/
id: string;
/**
* URL slug used on speedrun.com
*/
Expand Down
2 changes: 2 additions & 0 deletions src/pages/[game]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import LoadingBlock from "~/components/loading-block";
const GamePage: NextPage = () => {
const router = useRouter();

// TODO: make this use a cached value from the home page, instead of a second query
const { data: previewData } = useQuery<schema.GetGamePagePreview>(
GetGamePagePreview,
{
Expand Down Expand Up @@ -114,6 +115,7 @@ export default withApollo(GamePage);
const GetGamePagePreview = gql`
query GetGamePagePreview($slug: String!) {
game(slug: $slug) {
id
srcSlug
name
}
Expand Down
1 change: 1 addition & 0 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ const GetHomeStats = gql`
const GetGameIndex = gql`
query GetGameIndex {
games {
id
srcSlug
name
}
Expand Down

1 comment on commit e03ab0b

@vercel
Copy link

@vercel vercel bot commented on e03ab0b Feb 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.