This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
1 parent
4109726
commit cb86a78
Showing
20 changed files
with
2,648 additions
and
152 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
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
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,9 +1,9 @@ | ||
pergel: | ||
# This file is generated by pergel. Do not edit it manually. | ||
# Version: 0.3.0 | ||
# Version: 0.3.1 | ||
rocket: | ||
nodeCron: | ||
graphqlYoga: | ||
# If pergel cli is installed, you can run `pergel install` automatically to install | ||
packageJson: | ||
dependencies: "node-cron@^3.0.3" | ||
devDependencies: "@types/node-cron@^3.0.11" | ||
dependencies: "@pergel/graphql@0.0.0" | ||
devDependencies: "" |
7 changes: 7 additions & 0 deletions
7
examples/p-graphqlYoga/pergel/rocket/graphqlYoga/documents/book.graphql
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,7 @@ | ||
query book { | ||
book(id: 1) { | ||
id | ||
name | ||
} | ||
} | ||
|
13 changes: 13 additions & 0 deletions
13
examples/p-graphqlYoga/pergel/rocket/graphqlYoga/index.d.ts
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,13 @@ | ||
declare module 'pergel/rocket/types' { | ||
|
||
import type { IncomingMessage, ServerResponse } from 'node:http' | ||
import type { H3Event } from 'h3' | ||
import type { YogaInitialContext } from 'graphql-yoga' | ||
|
||
interface GraphqlYogaContext extends YogaInitialContext { | ||
res: ServerResponse | ||
req: IncomingMessage | ||
event: H3Event | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
examples/p-graphqlYoga/pergel/rocket/graphqlYoga/schema/book.graphql
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,14 @@ | ||
type Query { | ||
book(id: ID!): Book! | ||
books: [Book!]! | ||
} | ||
|
||
type Book { | ||
id: ID! | ||
name: String! | ||
email: String! | ||
password: String! | ||
createdAt: String! | ||
updatedAt: String | ||
} | ||
|
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,13 @@ | ||
type Query { | ||
book(id: ID!): Book! | ||
books: [Book!]! | ||
} | ||
|
||
type Book { | ||
id: ID! | ||
name: String! | ||
email: String! | ||
password: String! | ||
createdAt: String! | ||
updatedAt: String | ||
} |
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,35 @@ | ||
import { createSchema } from 'graphql-yoga' | ||
import type { Resolvers } from 'pergel/rocket/graphqlYoga/server' | ||
import { schema } from 'pergel/rocket/graphqlYoga/schema' | ||
|
||
const resolvers: Resolvers = { | ||
Query: { | ||
book: (_root, _args, _context, _info) => { | ||
return { | ||
id: '1', | ||
name: 'hello', | ||
email: 'hello', | ||
createdAt: 'hello', | ||
password: 'hello', | ||
} | ||
}, | ||
}, | ||
} | ||
const schemas = createSchema({ | ||
typeDefs: schema, | ||
resolvers, | ||
}) | ||
|
||
export default pergelRocket().graphqlYoga().nitro().use({ | ||
onBeforeOptions: async ({ options }) => { | ||
options.add({ | ||
schema: schemas, | ||
}) | ||
}, | ||
async onBeforeContext({ options }) { | ||
const data = await options.add({ | ||
|
||
}) | ||
console.warn(data) | ||
}, | ||
}) |
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.