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

add documentation for the endpoint configuration in server #1000

Merged
merged 3 commits into from
May 11, 2022
Merged
Changes from 1 commit
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
20 changes: 20 additions & 0 deletions docs/source/configuration/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,26 @@ server:
listen: /tmp/router.sock
```

### Endpoint

By default, the router starts an HTTP server that exposes a `POST`/`GET` endpoint at path `/`. If you want to change the default behavior you can change it thanks to the `endpoint` properties in `server`.
bnjjj marked this conversation as resolved.
Show resolved Hide resolved
There are some rules to respect. If you want an endpoint which set a dynamic prefix in the path URL you can specify it with this syntax `endpoint: /:my_dynamic_prefix/graphql`, with this configuration you'll be able
to call routes like `/my_project_a/graphql`, `/my_other_project/graphql`, ... You can also add a wildcard as a suffix, here is an example, with this configuration `endpoint: /graphql/*` the router will
answer to all these routes `/graphql/my_project_a`, `/graphql/my_other_project`, ...

```yaml title="router.yaml"
#
# server: Configuration of the HTTP server
#
server:
# The exposed endpoint to answer to GraphQL queries
# (Defaults to /)
endpoint: /graphql
```

> Limitations: you can't have wildcmard in the middle of a path segment (eg: `/*/graphql`) you need to use the parameter notation instead (eg: `/:my_prefix/graphql`). An endpoint path must be absolute,
> which means must start with `/`.

### Introspection

By default, the router answers to some introspection queries. You can override this behavior to disable the introspection like so:
Expand Down