Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
rderbier committed Nov 18, 2024
1 parent 66ea70c commit f9c8368
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions dgraph-101/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,25 @@ Modus is code first, simply define you data using classes.
In this example we are using `Product` and `Category` defined in `classes.ts` file.

## Define your API.

index.ts is where we export the functions that are exposed as GraphQL operations.

This project defines the following operations:

- upsertProduct
- getProduct
- deleteProduct

Note that Modus is exposing `getProduct` as `product` to follow common coding and GraphQL practices.
Modus also exposes `upsertProduct` and `deleteProduct` as a GraphQL Mutation automatically.

- getProductsByCategory
The data is saved in Dgraph as a graph.
This function shows how to easily use the relationships in the graph.

- searchProducts
Finally we are using an AI model to create text embeddings for our Products.

As the embeddings are stored in Dgraph for each Product entity, we can easily expose an API to search by natural language and similarity


0 comments on commit f9c8368

Please sign in to comment.