chore(js): use spectaql for graphqldoc

This commit is contained in:
simon lehericey 2023-12-13 17:34:06 +01:00
parent b308b41ec6
commit 40df0395e8
3 changed files with 2032 additions and 62 deletions

View file

@ -62,6 +62,7 @@
"react-popper": "^2.3.0", "react-popper": "^2.3.0",
"react-query": "^3.39.3", "react-query": "^3.39.3",
"sortablejs": "^1.15.0", "sortablejs": "^1.15.0",
"spectaql": "^2.3.0",
"stimulus-use": "^0.52.0", "stimulus-use": "^0.52.0",
"terser": "^5.18.2", "terser": "^5.18.2",
"tiny-invariant": "^1.3.1", "tiny-invariant": "^1.3.1",
@ -110,16 +111,12 @@
"lint:js": "eslint --ext .js,.jsx,.ts,.tsx ./app/javascript", "lint:js": "eslint --ext .js,.jsx,.ts,.tsx ./app/javascript",
"webpack:build": "NODE_ENV=production bin/webpack", "webpack:build": "NODE_ENV=production bin/webpack",
"lint:types": "tsc", "lint:types": "tsc",
"graphql:doc:build": "RAILS_ENV=production bin/rake graphql:schema:json && graphdoc --force", "graphql:doc:build": "RAILS_ENV=production bin/rake graphql:schema:idl && spectaql spectaql_config.yml",
"postinstall": "patch-package", "postinstall": "patch-package",
"test": "vitest", "test": "vitest",
"coverage": "vitest run --coverage" "coverage": "vitest run --coverage"
}, },
"engines": { "engines": {
"node": ">= 18.17.0" "node": ">= 18.17.0"
},
"graphdoc": {
"schemaFile": "./app/graphql/schema.json",
"output": "./public/graphql/schema"
} }
} }

26
spectaql_config.yml Normal file
View file

@ -0,0 +1,26 @@
spectaql:
displayAllServers: true
targetDir: public/graphql/schema
introspection:
removeTrailingPeriodFromDescriptions: false
schemaFile: app/graphql/schema.graphql
extensions:
graphqlScalarExamples: true
info:
title: Schema de l'API GraphQL de demarches-simplifiees.fr
contact:
name: équipe support
url: https://doc.demarches-simplifiees.fr/api-graphql
email: contact@demarches-simplifiees.fr
servers:
- url: https://www.demarches-simplifiees.fr/api/v2/graphql
description: Production
production: true
headers:
- name: Authorization
example: Bearer <YOUR_TOKEN_HERE>
comment: Create your token in https://www.demarches-simplifiees.fr/profil

2061
yarn.lock

File diff suppressed because it is too large Load diff