Skip to main content

GraphQL Application with MongoDB​

View as Markdown

This is a sample app to test Keploy integration capabilities using rust and MongoDb. Buckle up, it's gonna be a fun ride!

Running App Locally on Linux/WSL πŸ§β€‹

This section runs on Linux or WSL. On macOS, run it inside a Lima VM β€” Keploy's native macOS and Windows support is tested with Go, Node.js, Python and Java apps.

Don’t have Keploy installed yet?

Before running this sample, make sure Keploy is installed on your system.

πŸ‘‰ Go to Installation Guide

Clone a sample Rust app πŸ§ͺ​

git clone https://github.com/keploy/samples-rust && cd samples-rust/gql-mongo

We will be using Docker compose to run Mongo on Docker container.

Let's start the MongoDB Instance​

docker compose up -d

Capture testcase​

sudo -E env PATH=$PATH keploy record -c 'cargo run'

Generate testcase​

Go to the localhost:8000 and create some queries.

We will get the following output in our terminal

Test-case

Run the testcases​

Now, let's run the keploy in test mode again:-

sudo -E env PATH=$PATH keploy test -c 'cargo run'
TestRun

Voila!! Our testcases has passed 🌟

Hope this helps you out, if you still have any questions, reach out to us .