-
Notifications
You must be signed in to change notification settings - Fork 3
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
5 changed files
with
53 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"use client" | ||
|
||
import { | ||
ApolloClient, | ||
InMemoryCache, | ||
ApolloProvider as _ApolloProvider, | ||
} from "@apollo/client" | ||
import { PropsWithChildren } from "react" | ||
|
||
const apolloClient = new ApolloClient({ | ||
uri: `${process.env.NEXT_PUBLIC_BEATFORGE_API_URL}/graphql`, | ||
cache: new InMemoryCache(), | ||
}) | ||
|
||
const ApolloProvider = (props: PropsWithChildren) => { | ||
return ( | ||
<_ApolloProvider client={apolloClient}>{props.children}</_ApolloProvider> | ||
) | ||
} | ||
|
||
export default ApolloProvider |
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,25 @@ | ||
"use client" | ||
|
||
import { gql } from "@beatforge/web/__generated__" | ||
import { useQuery } from "@apollo/client" | ||
|
||
const getModsQuery = gql(/* GraphQL */ ` | ||
query GetMods { | ||
mods { | ||
name | ||
id | ||
} | ||
} | ||
`) | ||
|
||
const Mods = () => { | ||
const { data, error } = useQuery(getModsQuery) | ||
return ( | ||
<main className=""> | ||
<h1>Mods</h1> | ||
<pre>{JSON.stringify(data, null, 2)}</pre> | ||
</main> | ||
) | ||
} | ||
|
||
export default Mods |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.