Skip to content

Commit

Permalink
add spectaql docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dklimpel committed Jan 7, 2024
1 parent ba95dd0 commit dfa947e
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build and deploy the documentation

on:
push:
branches: [ main ]
branches: [ main, test_spectaql ]
pull_request:
branches: [ main ]
branches: [ main, test_spectaql ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -43,6 +43,9 @@ jobs:
- name: Build the documentation
run: sh misc/build-docs.sh

- name: Build the spectaql
run: sh misc/build-spectaql.sh

- name: Fix permissions
run: |
chmod -c -R +rX "target/book/" | while read line; do
Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ A hosted version is available at <https://matrix-org.github.io/matrix-authentica

- Technical documentation for individual crates: [`rustdoc`](./rustdoc/mas_handlers/)
- UI components: [`storybook`](./storybook/)
- GraphQL: [`storybook`](./spectaql/)
10 changes: 10 additions & 0 deletions misc/build-spectaql.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

set -eux

# Sanity check
npx --version

npm install spectaql

npx spectaql ./spectaql/config.yml
43 changes: 43 additions & 0 deletions spectaql/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
spectaql:
# logoFile: ./spectaql/logo.png
# faviconFile: ./spectaql/favicon.png
targetDir: ./target/book/spectaql
displayAllServers: true

introspection:
removeTrailingPeriodFromDescriptions: false
schemaFile: ./frontend/schema.graphql
queryNameStrategy: capitalizeFirst
fieldExpansionDepth: 2

spectaqlDirective:
enable: true

extensions:
graphqlScalarExamples: true

info:
title: GraphQL API Reference
description: Welcome to the party!
termsOfService: https://www.example.com/terms
contact:
name: API Support
url: http://www.example.com/support
email: [email protected]
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
x-introItems:
- title: Important thing 1
description: Some important stuff we wanted you to know. Supports `markdown`

servers:
- url: https://staging.example.com/graphql
description: Staging
- url: https://auth-oidc.lab.element.dev/graphql
description: Production
production: true
headers:
- name: Authorization
example: Bearer <YOUR_TOKEN_HERE>
comment: Your foo from bar

0 comments on commit dfa947e

Please sign in to comment.