Skip to content

Commit 38315aa

Browse files
committed
chore(doc): live deno and sponsorship
1 parent e95bc65 commit 38315aa

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

README.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
GraphQL development for Deno Fresh.
44

5+
## Live Demo
6+
7+
1. [`graphql-yoga`](https://fresh-graphql-yoga.deno.dev/graphql)
8+
1. `apollo-server` (soon<sup>TM</sup>)
9+
510
## Why `fresh_graphql`?
611

712
1. Familiar developer experience with `fresh` projects.
@@ -10,7 +15,9 @@ GraphQL development for Deno Fresh.
1015

1116
## Installation
1217

13-
`fresh_graphql` hooks into the `dev.ts` lifecycle of fresh, [create a fresh project](https://fresh.deno.dev/docs/getting-started/create-a-project) if you haven't done so.
18+
`fresh_graphql` hooks into the `dev.ts` lifecycle of fresh,
19+
[create a fresh project](https://fresh.deno.dev/docs/getting-started/create-a-project)
20+
if you haven't done so.
1421

1522
You need to patch 3 files from an existing fresh project:
1623

@@ -65,7 +72,8 @@ await dev(import.meta.url, "./main.ts");
6572

6673
### Entrypoint
6774

68-
Any data handler routes would work, the example below uses `/graphql` as a convension.
75+
Any data handler routes would work, the example below uses `/graphql` as a
76+
convension.
6977

7078
```ts
7179
// routes/graphql.ts
@@ -88,12 +96,15 @@ export const handler = async (req: Request, ctx: HandlerContext) => {
8896
};
8997
```
9098

91-
1. `@graphql-yoga/common` is chosen for it's simplicity, you may use any GraphQL serveres compatible with `@graphql-tools/schema`.
92-
1. `fresh_graphql.gen.ts` This is the manifest file generated whenever you make changes to source codes in the `./graphql` directory.
99+
1. `@graphql-yoga/common` is chosen for it's simplicity, you may use any GraphQL
100+
serveres compatible with `@graphql-tools/schema`.
101+
1. `fresh_graphql.gen.ts` This is the manifest file generated whenever you make
102+
changes to source codes in the `./graphql` directory.
93103

94104
### Queries and Mutations
95105

96-
The example below follows the naming convension and use `mod.ts`, but you may name your TypeScript and/or JavaScript files anyway you like.
106+
The example below follows the naming convension and use `mod.ts`, but you may
107+
name your TypeScript and/or JavaScript files anyway you like.
97108

98109
```ts
99110
// ./graphql/Query/test/mod.ts
@@ -107,9 +118,12 @@ export const schema = `
107118
export const resolver = () => "Hello World!";
108119
```
109120

110-
Schema level types, `Query`, `Mutation` and `Subscription`, will be automatically created when such a corresponding extension statement is found.
121+
Schema level types, `Query`, `Mutation` and `Subscription`, will be
122+
automatically created when such a corresponding extension statement is found.
111123

112-
Resolver object will be wrapped according to the directory structure, i.e. `{ Query: { foo: resolver } }`. To override this behavior, export an object instead.
124+
Resolver object will be wrapped according to the directory structure, i.e.
125+
`{ Query: { foo: resolver } }`. To override this behavior, export an object
126+
instead.
113127

114128
```ts
115129
export const resolver = {
@@ -137,3 +151,8 @@ export const resolver = async function* (_, { from }) {
137151
}
138152
};
139153
```
154+
155+
## Sponsorship
156+
157+
If you think I did a good job or want to see a feature happening,
158+
[a coffee would do](https://buymeacoffee.com/vicary).

0 commit comments

Comments
 (0)