Skip to content

Commit

Permalink
add /api/graphql sandbox docs
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmwang committed Feb 24, 2025
1 parent 5510c01 commit 9e3dcf8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/src/core/backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ The bulk of the application logic is split into separate modules within the `src
│ └── resolver.ts # GraphQL resolver
```

### Inside a Module
#### Inside a Module

<p align="center">
<img
Expand Down Expand Up @@ -95,7 +95,7 @@ The above diagram shows a simplified request-to-response pipeline within a modul

[^3]: Fields not requested are automatically removed.

### Database Models
#### Database Models

In addition to the API server, the backend service is responsible for managing MongoDB usage—specifically, how our data is organized and defined through collections, models, and indexes.

Expand Down Expand Up @@ -133,3 +133,9 @@ export const TermModel: Model<ITermItem> = model<ITermItem>(
termSchema
);
```

### Testing the API

To test the GraphQL API, it is recommended to first [seed the local database](../../getting-started/local-development.md#seeding-local-database) in order to have data.

API testing is mainly done through the [Apollo GraphQL Sandbox](https://www.apollographql.com/docs/apollo-sandbox) available at `http://localhost:8080/api/graphql` when the backend container is running. While the UI is helpful for creating queries for you, it is highly recommended to review the [GraphQL docs](https://graphql.org/learn/), specifically the [queries](https://graphql.org/learn/queries/) and [mutations](https://graphql.org/learn/mutations/) pages.

0 comments on commit 9e3dcf8

Please sign in to comment.