Skip to content

Commit

Permalink
Document the SSE handler for subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
chrzaszcz committed Nov 8, 2022
1 parent 82ce031 commit 95cfce5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/graphql-api/Admin-GraphQL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ We can distinguish two levels of the administration. A global admin (has access

There is only one schema for both admin types. Admin per domain simply has no permissions to execute global commands or commands with not owned domain. The API documentation clearly says which commands are global.

**Queries** and **mutations** can be executed with the POST or GET method, as specified in the [GraphQL documentation](https://graphql.org/learn/serving-over-http/). The endpoint URL is as configured in the Listen section, e.g. `http://localhost:5551/api/graphql` for the global admin.

**Subscriptions** can be executed with the GET method, and are handled with [Server-Sent Events (SSE)](https://html.spec.whatwg.org/multipage/server-sent-events.html). The endpoint URL is the same as for regular queries with the addition of `/sse`, e.g. `http://localhost:5551/api/graphql/sse` for the global admin.

## Domain admin configuration

Out of the box, domains are created with a disabled admin account. Admin per domain can be enabled only by the global admin with the command
Expand Down
4 changes: 4 additions & 0 deletions doc/graphql-api/User-GraphQL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

The new GraphQL user API contains all commands from the client REST API and provides plenty of new ones. Multiple commands previously available only for the admin have their counterparts for the user.

**Queries** and **mutations** can be executed with the POST or GET method, as specified in the [GraphQL documentation](https://graphql.org/learn/serving-over-http/). The endpoint URL is as configured in the Listen section, e.g. `http://localhost:5561/api/graphql`.

**Subscriptions** can be executed with the GET method, and are handled with [Server-Sent Events (SSE)](https://html.spec.whatwg.org/multipage/server-sent-events.html). The endpoint URL is the same as for regular queries with the addition of `/sse`, e.g. `http://localhost:5561/api/graphql/sse`.

## Authentication

MongooseIM uses *Basic Authentication* as the authentication method for the GraphQL API.
Expand Down

0 comments on commit 95cfce5

Please sign in to comment.