summaryrefslogtreecommitdiff
path: root/src/services/vyos-http-api-server
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2022-07-25 10:34:17 +0100
committerGitHub <noreply@github.com>2022-07-25 10:34:17 +0100
commit3337aedd5f7ff48bfad051d760023a188fdace70 (patch)
tree3dc5b5c22444430a74f8d0f8a8ed54415a8ccd47 /src/services/vyos-http-api-server
parente1e9f690d3eb4cd03aba118558fffd5b6b2920c8 (diff)
parentf9d6f089014007193996e51757f72a8bf7ec78b9 (diff)
downloadvyos-1x-3337aedd5f7ff48bfad051d760023a188fdace70.tar.gz
vyos-1x-3337aedd5f7ff48bfad051d760023a188fdace70.zip
Merge pull request #1431 from jestabro/gql-dev
graphql: T4567: Merge experimental branch of GraphQL development
Diffstat (limited to 'src/services/vyos-http-api-server')
-rwxr-xr-xsrc/services/vyos-http-api-server7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/services/vyos-http-api-server b/src/services/vyos-http-api-server
index e9b904ba8..af8837e1e 100755
--- a/src/services/vyos-http-api-server
+++ b/src/services/vyos-http-api-server
@@ -654,11 +654,13 @@ def graphql_init(fast_api_app):
schema = generate_schema()
+ in_spec = app.state.vyos_introspection
+
if app.state.vyos_origins:
origins = app.state.vyos_origins
- app.add_route('/graphql', CORSMiddleware(GraphQL(schema, debug=True), allow_origins=origins, allow_methods=("GET", "POST", "OPTIONS")))
+ app.add_route('/graphql', CORSMiddleware(GraphQL(schema, debug=True, introspection=in_spec), allow_origins=origins, allow_methods=("GET", "POST", "OPTIONS")))
else:
- app.add_route('/graphql', GraphQL(schema, debug=True))
+ app.add_route('/graphql', GraphQL(schema, debug=True, introspection=in_spec))
###
@@ -684,6 +686,7 @@ if __name__ == '__main__':
app.state.vyos_debug = server_config['debug']
app.state.vyos_gql = server_config['gql']
+ app.state.vyos_introspection = server_config['introspection']
app.state.vyos_strict = server_config['strict']
app.state.vyos_origins = server_config.get('cors', {}).get('origins', [])