Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix sidebar for documentation and /api-v16 #4331

Open
wants to merge 4 commits into
base: 16.x.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions website/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import nextra from 'nextra';
import path from 'node:path';
import vercel from './vercel.json' with { type: 'json' }

const withNextra = nextra({
theme: 'nextra-theme-docs',
Expand Down Expand Up @@ -27,6 +28,7 @@ export default withNextra({
});
return config;
},
redirects: async () => vercel.redirects,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to have same redirects locally

output: 'export',
images: {
loader: 'custom',
Expand Down
27 changes: 3 additions & 24 deletions website/pages/_meta.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,8 @@
const meta = {
index: '',
'-- 1': {
type: 'separator',
title: 'GraphQL.JS Tutorial',
docs: {
type: 'page',
title: 'Documentation'
Comment on lines +2 to +4
Copy link
Author

@dimaMachina dimaMachina Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to group mdx pages under some folder and set type: page so we'll have proper sidebar

},
'getting-started': '',
'running-an-express-graphql-server': '',
'graphql-clients': '',
'basic-types': '',
'passing-arguments': '',
'object-types': '',
'mutations-and-input-types': '',
'authentication-and-express-middleware': '',
'-- 2': {
type: 'separator',
title: 'Advanced Guides',
},
'constructing-types': '',
'oneof-input-objects': 'OneOf input objects',
'defer-stream': '',
'-- 3': {
type: 'separator',
title: 'FAQ',
},
'going-to-production': '',
'api-v16': {
type: 'menu',
title: 'API',
Expand Down
29 changes: 29 additions & 0 deletions website/pages/docs/_meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const meta = {
index: '',
'-- 1': {
type: 'separator',
title: 'GraphQL.JS Tutorial',
},
'getting-started': '',
'running-an-express-graphql-server': '',
'graphql-clients': '',
'basic-types': '',
'passing-arguments': '',
'object-types': '',
'mutations-and-input-types': '',
'authentication-and-express-middleware': '',
'-- 2': {
type: 'separator',
title: 'Advanced Guides',
},
'constructing-types': '',
'oneof-input-objects': '',
'defer-stream': '',
'-- 3': {
type: 'separator',
title: 'FAQ',
},
'going-to-production': '',
};

export default meta;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const schema = buildSchema(`
shelfNumber: Int!
positionOnShelf: Int!
}
input ProductSpecifier @oneOf {
id: ID
name: String
Expand Down Expand Up @@ -88,4 +88,4 @@ const schema = new GraphQLSchema({

It doesn't matter whether you have 2 or more inputs here, all that matters is
that your user will have to specify one, and only one, for this input to be valid.
The values are not limited to scalars, lists and other input object types are also allowed.
The values are not limited to scalars, lists and other input object types are also allowed.
1 change: 0 additions & 1 deletion website/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module.exports = {
content: [
'./pages/**/*.{ts,tsx,mdx}',
'./icons/**/*.{ts,tsx,mdx}',
'./css/**/*.css',
Copy link
Author

@dimaMachina dimaMachina Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should not include *.css for tailwindcss

'./theme.config.tsx',
],
theme: {
Expand Down
5 changes: 5 additions & 0 deletions website/vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"source": "/api",
"destination": "/api-v16/graphql",
"permanent": true
},
{
"source": "/",
"destination": "/docs",
"permanent": true
}
]
}
Loading