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
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ Description! And a link to a [reference](http://url)
## 🐛 Fixes ( :bug: )
## 🛠 Maintenance ( :hammer_and_wrench: )
## 📚 Documentation ( :books: )
### Add documentation for the endpoint configuration in server ([PR #1000](https://github.com/apollographql/router/pull/1000))
Documentation about setting a custom endpoint path for GraphQL queries has been added.

## 🐛 Fixes ( :bug: )
26 changes: 26 additions & 0 deletions docs/source/configuration/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,32 @@ server:
listen: /tmp/router.sock
```

### Endpoint

By default, the router starts an HTTP server that exposes a `POST`/`GET` endpoint at path `/`.

To change the default behavior set `server.endpoint` within your `router.yaml`.

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

Wildcards and parameters are supported. For instance:

- `/:my_dynamic_prefix/graphql` matches `/my_project_a/graphql`, `/my_other_project/graphql`
- `/graphql/*` matches `/graphql/my_project_a`, `/graphql/my_other_project`

> Note:
>
> Wildcard in the middle of a path segment (eg: `/*/graphql`) is not supported. Use the parameter notation instead (eg: `/:my_prefix/graphql`).
> Endpoints 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