33.1 An endpoint in the admin UI
Open a database, choose API, then New endpoint. The new endpoint answers on /graphql, or
/graphql2 and so on when that is taken, and starts with no types chosen. The editor has seven
views:
| View | What it is for |
|---|---|
| Settings | Name, url, description, mode, switches, limits and API keys (§33.2). |
| Types | The node types and properties to expose, and their GraphQL names. Read only keeps a type out of the mutations. Used in the Selected mode only. |
| Views | Root fields defined by a query (§33.5). |
| Code | The schema as SDL, and TypeScript and C# types and clients, to copy or download. |
| Try it | Runs a query. Pick a type and an example query to start from. |
| Explorer | The explorer of §33.8. |
| Json | The definition file, editable as text. |
Add key, in Settings, adds a generated API key that expires in a year. Name it after the client that uses it. You can change or clear the expiry date.
The editor works on a draft, so you see the schema a change gives before you save. Warnings say what the schema leaves out or renames. Errors, such as a url another endpoint uses, block saving. Save writes the file, and the next request gets the new schema, with no restart.
In the endpoint list, buttons open each endpoint's public pages: Explore (the explorer), Pivot (the facet page) and SDL (the schema as text).
An endpoint's url can be any path the admin UI does not use, and must be unique on the server,
across databases. While the database is not open, the url answers 503.