-
-
Notifications
You must be signed in to change notification settings - Fork 179
Open
Description
Hello there,
The new documentation website looks amazing, congratulations !
I have a few suggestions to improve it.
- TwoSlash for code blocks
There's an intergration with fumadocs so it shouldn't be hard :
https://fumadocs.vercel.app/docs/ui/twoslash
- Show generated schemas everywhere
It would be nice if every code block had some kind of tab to show the generated schema.
For example for the Hello World Example :
import { createYoga } from 'graphql-yoga';
import { createServer } from 'node:http';
import SchemaBuilder from '@pothos/core';
const builder = new SchemaBuilder({});
builder.queryType({
fields: (t) => ({
hello: t.string({
args: {
name: t.arg.string(),
},
resolve: (parent, { name }) => `hello, ${name || 'World'}`,
}),
}),
});
const yoga = createYoga({
schema: builder.toSchema(),
});
const server = createServer(yoga);
server.listen(3000, () => {
console.log('Visit http://localhost:3000/graphql');
});It would show something like this in another tab, or in a collapsable frame :
type Query {
hello(name: String): String!
}It's already the case in some places in the docs like here https://pothos-graphql.dev/docs/plugins/errors#example-usage
Ideally you'd want a build step that generate these from the source code.
What do you think ?
Metadata
Metadata
Assignees
Labels
No labels