-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Agregando soporte para graphql, (apollo + code-gen) en Edge/RSC (#11)
- Loading branch information
Showing
33 changed files
with
1,596 additions
and
559 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
src/api/types.ts | ||
src/api/gql/**/* | ||
src/**/*.generated.* |
4 changes: 1 addition & 3 deletions
4
src/app/(transition)/(root)/layout.tsx → app/(transition)/(root)/layout.tsx
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,32 @@ | ||
import { getApolloClient } from "../../../src/api/ApolloClient"; | ||
import { LandingPageEvents } from "../../../src/components/features/LandingPageEvents"; | ||
import { | ||
FetchExampleEventsDocument, | ||
FetchExampleEventsQuery, | ||
} from "../../../src/components/features/LandingPageEvents/graphql/FetchExampleEvents.generated"; | ||
|
||
export default async function Home() { | ||
const c = getApolloClient(); | ||
const variable = await c.query<FetchExampleEventsQuery>({ | ||
query: FetchExampleEventsDocument, | ||
}); | ||
return ( | ||
<main className="flex max-w-5xl flex-col items-center justify-between px-6 pt-36 transition-all md:px-10 md:pt-44 xl:px-0 xl:pt-52"> | ||
<div className="flex flex-col gap-16 pb-4"> | ||
<h1 className="flex flex-col justify-start gap-7 text-left text-6xl font-extrabold shadow-slate-900 transition-all text-shadow sm:text-7xl xl:text-8xl"> | ||
<span>TICKETS</span> | ||
</h1> | ||
</div> | ||
<div className="flex flex-col gap-4"> | ||
<h1>RSC</h1> | ||
{variable.data?.events?.map((event) => <div>{event.id}</div>)} | ||
</div> | ||
<div className="flex flex-col gap-4"> | ||
<h1>Client fetching</h1> | ||
<LandingPageEvents /> | ||
</div> | ||
</main> | ||
); | ||
} | ||
|
||
export const runtime = "edge"; |
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
File renamed without changes.
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import type { IGraphQLConfig } from "graphql-config"; | ||
|
||
const config: IGraphQLConfig = { | ||
schema: "https://api.jsconf.dev/graphql", | ||
documents: ["src/**/*.gql"], | ||
schema: "https://api.jsconf.dev/graphql", // TODO: Usar dotenv para que esta variable dependa de las variables de entorno. | ||
documents: ["src/**/*.gql", "!src/api/**/*.gql"], | ||
}; | ||
|
||
export default config; |
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
poweredByHeader: false, | ||
typedRoutes: true, | ||
}; | ||
|
||
module.exports = nextConfig; |
Oops, something went wrong.