Skip to content

Commit

Permalink
v0.6 (closes #49 and #56)
Browse files Browse the repository at this point in the history
  • Loading branch information
mishushakov committed Sep 23, 2023
1 parent a698263 commit a677a30
Show file tree
Hide file tree
Showing 18 changed files with 1,265 additions and 1,220 deletions.
8 changes: 4 additions & 4 deletions .vitepress/config.js → .vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export default defineConfig({
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
logo: {
light: 'logo/r6N.svg',
dark: 'logo/r5m.svg',
light: '/logo/r6N.svg',
dark: '/logo/r5m.svg',
},
// logo: {
// light: 'logo/r6p.svg',
// dark: 'logo/r5y.svg'
// light: '/logo/r6p.svg',
// dark: '/logo/r5y.svg'
// },
siteTitle: false,
nav: [
Expand Down
9 changes: 7 additions & 2 deletions .vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:root {
--vp-c-brand: #3230df;
--vp-c-brand-1: #3230df;
--vp-c-brand-dark: #3230df;
--vp-code-block-bg: #f6f8fa;
--vp-c-text-1: #3f3f46;
Expand All @@ -9,10 +9,11 @@
--vp-code-tab-active-text-color: var(--vp-c-text-1);
--vp-code-tab-hover-text-color: var(--vp-c-text-1);
--vp-code-line-highlight-color: rgba(0,0,0,.05);
--vp-code-color: inherit
}

.dark {
--vp-c-brand: rgb(94,92,230);
--vp-c-brand-1: rgb(94,92,230);
--vp-c-brand-dark: rgb(94,92,230);
--vp-c-bg-alt: #131316;
--vp-c-bg: #18181B;
Expand Down Expand Up @@ -70,3 +71,7 @@ code.nav {
font-weight: 700;
text-transform: uppercase;
}

.vp-doc a {
text-decoration: none;
}
File renamed without changes.
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,13 @@
https://user-images.githubusercontent.com/10400064/222474710-bc263775-06b8-4a78-8099-676a9ad3c7a4.mov

> **Warning**:
> We would love to hear your Feedback on our [Discord](https://discord.gg/KqJJzJ3BTu)
> We would love to hear your Feedback in our [Discord](https://discord.gg/KqJJzJ3BTu)
> **Note**:
> tRPC-style client for Garph has arrived! See [garph-gqty](https://github.com/stepci/garph-gqty) for more 🚀
Garph is a fullstack GraphQL framework for TypeScript, that aims to deliver the best GraphQL Developer-Experience.

> **Garph 0.5 was just released!** 🙌
>
> Changelog:
> - Updated the React-client
> - Added GraphQL Subscriptions
> - Cursor-based pagination
> - Included Relay building blocks (nodes, edges, connections)
> - Additional type-safety for resolvers
> - Updated Documentation
## Get started

1. Install the dependencies
Expand Down Expand Up @@ -87,4 +77,4 @@ Example projects can be found under [examples/](examples/)

## Feedback

We would love to hear your Feedback on our [Discord](https://discord.gg/KqJJzJ3BTu) community
We would love to hear your Feedback in our [Discord](https://discord.gg/KqJJzJ3BTu) community
51 changes: 51 additions & 0 deletions examples/deferstream.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { g, InferResolvers, buildSchema } from './../src/index'
import { createYoga } from 'graphql-yoga'
import { useDeferStream } from '@graphql-yoga/plugin-defer-stream'
import { createServer } from 'node:http'

const queryType = g.type('Query', {
alphabet: g.string().list().description(`This field can be @stream'ed`),
fastField: g.string().description('A field that resolves fast.'),
slowField: g
.string()
.optional()
.description(
'A field that resolves slowly. Maybe you want to @defer this field ;)'
)
.args({
waitFor: g.int().default(5000),
})
})

const wait = (time: number) => new Promise(resolve => setTimeout(resolve, time))

const resolvers: InferResolvers<{ Query: typeof queryType }, {}> = {
Query: {
async *alphabet() {
for (const character of ['a', 'b', 'c', 'd', 'e', 'f', 'g']) {
yield character
await wait(1000)
}
},
fastField: async () => {
await wait(100)
return 'I am speed'
},
slowField: async (_, { waitFor }) => {
await wait(waitFor)
return 'I am slow'
}
}
}

const schema = buildSchema({ g, resolvers })
const yoga = createYoga({
schema,
plugins: [useDeferStream()]
})

const server = createServer(yoga)

server.listen(4000, () => {
console.info('Server is running on http://localhost:4000/graphql')
})
Loading

0 comments on commit a677a30

Please sign in to comment.