Skip to content

Commit cb847fb

Browse files
huijingbrad-dow
andauthored
feat: migrate from astro-graphql-plugin to spectaql (#3536)
* feat: migrate from astro-graphql-plugin to spectaql * run prettier * fix broken links * adjust link validator config * adjust link validator config * fix broken links * add custom pages to search indexing * run prettier --------- Co-authored-by: brad-dow <162852233+brad-dow@users.noreply.github.com>
1 parent 7e61af4 commit cb847fb

File tree

16 files changed

+24272
-619
lines changed

16 files changed

+24272
-619
lines changed

packages/documentation/astro.config.mjs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import starlight from '@astrojs/starlight'
33

44
import remarkMath from 'remark-math'
55
import rehypeMathjax from 'rehype-mathjax'
6-
import GraphQL from 'astro-graphql-plugin'
76
import starlightLinksValidator from 'starlight-links-validator'
87
import starlightFullViewMode from 'starlight-fullview-mode'
98
import { rehypeHeadingIds } from '@astrojs/markdown-remark'
@@ -308,16 +307,20 @@ export default defineConfig({
308307
},
309308
{
310309
label: 'Backend Admin API',
311-
collapsed: true,
312-
autogenerate: {
313-
directory: 'apis/graphql/backend'
310+
link: '/apis/graphql/backend',
311+
attrs: {
312+
target: '_blank',
313+
rel: 'noopener noreferrer',
314+
'data-icon': 'external'
314315
}
315316
},
316317
{
317318
label: 'Auth Admin API',
318-
collapsed: true,
319-
autogenerate: {
320-
directory: 'apis/graphql/auth'
319+
link: '/apis/graphql/auth',
320+
attrs: {
321+
target: '_blank',
322+
rel: 'noopener noreferrer',
323+
'data-icon': 'external'
321324
}
322325
}
323326
]
@@ -355,21 +358,18 @@ export default defineConfig({
355358
],
356359
plugins: [
357360
starlightLinksValidator({
361+
exclude: [
362+
'/apis/graphql/auth',
363+
'/apis/graphql/backend',
364+
'/apis/graphql/auth/*',
365+
'/apis/graphql/backend/*'
366+
],
358367
errorOnLocalLinks: false,
359-
errorOnFallbackPages: false
368+
errorOnFallbackPages: false,
369+
errorOnInvalidHashes: false
360370
}),
361371
starlightFullViewMode()
362372
]
363-
}),
364-
GraphQL({
365-
schema: '../backend/src/graphql/schema.graphql',
366-
output: './src/content/docs/apis/graphql/backend/',
367-
linkPrefix: '/apis/graphql/backend/'
368-
}),
369-
GraphQL({
370-
schema: '../auth/src/graphql/schema.graphql',
371-
output: './src/content/docs/apis/graphql/auth/',
372-
linkPrefix: '/apis/graphql/auth/'
373373
})
374374
],
375375
server: {
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
spectaql:
2+
oneFile: true
3+
targetDir: ./src/pages/apis/graphql/auth
4+
logoFile: ./public/img/logo.png
5+
embedLogo: true
6+
faviconUrl: /favicon.svg
7+
displayAllServers: true
8+
9+
introspection:
10+
removeTrailingPeriodFromDescriptions: false
11+
schemaFile: '../auth/src/graphql/schema.graphql'
12+
queryNameStrategy: capitalizeFirst
13+
fieldExpansionDepth: 2
14+
15+
spectaqlDirective:
16+
enable: true
17+
18+
extensions:
19+
graphqlScalarExamples: true
20+
21+
info:
22+
title: Auth Admin API
23+
description: The Auth Admin API allows you to get information about a grant, such as its status, state, related payment details, and the wallet address of the grantee’s account. The API also allows you to revoke grants.
24+
x-introItems:
25+
- title: Back to documentation
26+
url: /overview/overview
27+
x-hidePoweredBy: true
28+
29+
servers:
30+
- url: https://staging.example.com/graphql
31+
description: Staging
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
spectaql:
2+
oneFile: true
3+
targetDir: ./src/pages/apis/graphql/backend
4+
logoFile: ./public/img/logo.png
5+
embedLogo: true
6+
faviconUrl: /favicon.svg
7+
displayAllServers: true
8+
9+
introspection:
10+
removeTrailingPeriodFromDescriptions: false
11+
schemaFile: '../backend/src/graphql/schema.graphql'
12+
queryNameStrategy: capitalizeFirst
13+
fieldExpansionDepth: 2
14+
15+
spectaqlDirective:
16+
enable: true
17+
18+
extensions:
19+
graphqlScalarExamples: true
20+
21+
info:
22+
title: Backend Admin API
23+
description: The Backend Admin API provides you with comprehensive capabilities to manage your Rafiki instance. Core functionality includes managing peering relationships, assets, wallet addresses and their public keys, as well as liquidity management through deposits and withdrawals. Another important aspect of the Backend Admin API is to manage Open Payments resources like payments and quotes.
24+
x-introItems:
25+
- title: Back to documentation
26+
url: /overview/overview
27+
x-hidePoweredBy: true
28+
29+
servers:
30+
- url: https://staging.example.com/graphql
31+
description: Staging

packages/documentation/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@
1313
"@astrojs/starlight": "^0.34.4",
1414
"@interledger/docs-design-system": "^0.8.0",
1515
"astro": "5.11.0",
16-
"astro-graphql-plugin": "^0.4.2",
17-
"graphql": "16.11.0",
1816
"mermaid": "^11.8.1",
1917
"rehype-autolink-headings": "^7.1.0",
2018
"rehype-mathjax": "^7.1.0",
2119
"remark-math": "^6.0.0",
20+
"spectaql": "^3.0.4",
2221
"starlight-fullview-mode": "^0.2.3",
2322
"starlight-links-validator": "^0.17.0"
2423
}
6.9 KB
Loading

packages/documentation/src/content/docs/es/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ import { Card, CardGrid, LinkCard } from '@astrojs/starlight/components'
2727
Review the requirements for deploying Rafiki to a production environment.
2828
</Card>
2929
</a>
30-
<a class='card-link' href='/apis/graphql/backend/mutations/'>
30+
<a class='card-link' href='/apis/graphql/backend'>
3131
<Card title='View Backend API schema' icon='document'>
3232
Discover what's in our Backend GraphQL schema.
3333
</Card>
3434
</a>
35-
<a class='card-link' href='/apis/graphql/auth/mutations/'>
35+
<a class='card-link' href='/apis/graphql/auth'>
3636
<Card title='View Auth API schema' icon='document'>
3737
Discover what's in our Auth GraphQL schema.
3838
</Card>

packages/documentation/src/content/docs/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ import { Card, CardGrid, LinkCard } from '@astrojs/starlight/components'
2727
Review the requirements for deploying Rafiki to a production environment.
2828
</Card>
2929
</a>
30-
<a class='card-link' href='/apis/graphql/backend/mutations/'>
30+
<a class='card-link' href='/apis/graphql/backend'>
3131
<Card title='View Backend API schema' icon='document'>
3232
Discover what's in our Backend GraphQL schema.
3333
</Card>
3434
</a>
35-
<a class='card-link' href='/apis/graphql/auth/mutations/'>
35+
<a class='card-link' href='/apis/graphql/auth'>
3636
<Card title='View Auth API schema' icon='document'>
3737
Discover what's in our Auth GraphQL schema.
3838
</Card>

packages/documentation/src/content/docs/integration/deployment/helm-k8s.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ We recommended using the latest vendor supported version for each of the softwar
2424
Before you begin, ensure you have the following:
2525

2626
- <LinkOut href='https://kubernetes.io/'>Kubernetes</LinkOut> cluster deployed
27-
- <LinkOut href='https://kubernetes.io/docs/tasks/tools/'>kubectl</LinkOut> installed
28-
and configured
27+
- <LinkOut href='https://kubernetes.io/docs/tasks/tools/'>kubectl</LinkOut>
28+
installed and configured
2929
- <LinkOut href='https://helm.sh/docs/intro/install/'>Helm</LinkOut> installed
3030

3131
## Install Rafiki using Helm

packages/documentation/src/content/docs/integration/requirements/assets.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ An asset represents an item of value that can be transferred via the Interledger
3838
}
3939
}
4040
```
41-
For more information about this mutation's input object, see [`CreateAssetInput`](/apis/graphql/backend/inputobjects/#createassetinput).
41+
For more information about this mutation's input object, see [`CreateAssetInput`](/apis/graphql/backend/#definition-CreateAssetInput).
4242
</TabItem>
4343
<TabItem label="Response">
4444
```json

packages/documentation/src/content/docs/integration/requirements/open-payments/grants-revoking.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ query Grants(
8888
}
8989
}
9090
```
91-
For more information about this query's variables, see [`grants`](/apis/graphql/auth/queries/#grants).
91+
For more information about this query's variables, see [`grants`](/apis/graphql/auth/#query-grants).
9292
</TabItem>
9393

9494
<TabItem label='Response'>
@@ -170,7 +170,7 @@ mutation revokeGrant($input: RevokeGrantInput!) {
170170
}
171171
}
172172
```
173-
For more information about this mutation's input object, see [`RevokeGrantInput`](/apis/graphql/auth/inputobjects/#revokegrantinput).
173+
For more information about this mutation's input object, see [`RevokeGrantInput`](/apis/graphql/auth/#definition-RevokeGrantInput).
174174
</TabItem>
175175

176176
<TabItem label='Response'>

0 commit comments

Comments
 (0)