Skip to content

Commit 79ff587

Browse files
committed
...
1 parent d720ba5 commit 79ff587

28 files changed

+375
-162
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ dist
2424

2525
# debug
2626
npm-debug.log*
27+
package-lock.json
2728
yarn-debug.log*
2829
yarn-error.log*
2930
pnpm-lock.yaml

.npmignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
/examples/
1+
/.bolt
2+
/examples/
3+
.stackblitzrc
4+
tsconfig.reference.json

.stackblitzrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"installDependencies": true,
3+
"startCommand": "pnpm --filter @/example dev"
4+
}
File renamed without changes.

examples/next/package.json

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
11
{
2-
"name": "graphql-api-template-example",
2+
"name": "@/example",
33
"private": true,
44
"scripts": {
5-
"dev": "next dev",
5+
"dev": "next dev --turbopack",
66
"build": "next build",
77
"start": "next start",
8-
"lint": "next lint"
8+
"lint": "next lint",
9+
"next:upgrade": "pnpm dlx @next/codemod@canary upgrade canary"
910
},
1011
"dependencies": {
11-
"next": "12.0.10",
12-
"react": "17.0.2",
13-
"react-dom": "17.0.2"
12+
"@apollo/client": "^3.13.1",
13+
"@apollo/server": "^4.11.3",
14+
"@apollo/subgraph": "^2.10.0",
15+
"@apollo/utils.keyvaluecache": "^3.1.0",
16+
"@as-integrations/next": "^3.2.0",
17+
"@graphql-api/cron.local": "workspace:*",
18+
"graphql-scalars": "^1.24.1",
19+
"graphql-tag": "^2.12.6",
20+
"next": "^15.2.1-canary.2",
21+
"node-cron": "^3.0.3",
22+
"react": "^19",
23+
"react-dom": "^19",
24+
"urql": "^4.2.1"
1425
},
1526
"devDependencies": {
16-
"@types/node": "17.0.17",
17-
"@types/react": "17.0.39",
18-
"eslint": "8.9.0",
19-
"eslint-config-next": "12.0.10",
20-
"typescript": "4.5.5"
27+
"@types/node": "^22",
28+
"@types/react": "^19",
29+
"@types/react-dom": "^19",
30+
"eslint": "^9",
31+
"eslint-config-next": "15.2.1-canary.2",
32+
"typescript": "^5"
2133
}
22-
}
34+
}

examples/next/pages/_app.tsx

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/next/pages/api/hello.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

examples/next/pages/index.tsx

Lines changed: 0 additions & 72 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import type { GraphQLSchema } from 'graphql'
2+
import { ApolloServer } from '@apollo/server'
3+
import { startServerAndCreateNextHandler } from '@as-integrations/next'
4+
5+
import type { ApolloConfig, ApolloServerOptionsWithTypeDefs, BaseContext } from '@apollo/server'
6+
import { NextRequest } from 'next/server'
7+
8+
type GraphQLRouteOptions<Context extends BaseContext = BaseContext> = (
9+
| {
10+
typeDefs: ApolloServerOptionsWithTypeDefs<Context>['typeDefs']
11+
resolvers: ApolloServerOptionsWithTypeDefs<Context>['resolvers']
12+
}
13+
| { schema: GraphQLSchema }
14+
) &
15+
Partial<ApolloConfig>
16+
17+
18+
const server = new ApolloServer({
19+
typeDefs: "",
20+
resolvers: {}
21+
})
22+
const handler: (req: NextRequest) => void = startServerAndCreateNextHandler(server)
23+
24+
export {
25+
handler as GET,
26+
handler as POST
27+
}

examples/next/src/app/layout.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from "react";
2+
import '../styles/globals.css'
3+
4+
export default async function RootLayout({ children }: React.PropsWithChildren<{}>) {
5+
return <html>
6+
<head>
7+
<title>Create Next App</title>
8+
<meta name="description" content="Generated by create next app" />
9+
<link rel="icon" href="/favicon.ico" />
10+
</head>
11+
<body>
12+
{children}
13+
</body>
14+
</html>
15+
}

0 commit comments

Comments
 (0)