This sample project demonstrates how we can practice contract-driven development and contract testing in a GraphQL (Kotlin) API that depends on an external domain service. Here, Specmatic is used to mock calls to domain API service based on its OpenAPI specification.
- On Unix and Windows Powershell:
./gradlew bootRun- On Windows CMD Prompt:
gradlew bootRunYou'll need the backend product API server running for this to work. You can get it from here. The README.md file in the repo contain instructions for starting up the backend API server.
Visit http://localhost:8080/graphiql to access the GraphiQL interface.
- On Unix and Windows Powershell:
docker run --rm --network host -v "$(pwd):/usr/src/app" specmatic/enterprise mock- On Windows CMD Prompt:
docker run --rm --network host -v "%cd%:/usr/src/app" specmatic/enterprise mockdocker build --no-cache -t specmatic-order-bff-graphql .Then run the built image:
docker run -p 8080:8080 specmatic-order-bff-graphql- On Unix and Windows Powershell:
./gradlew bootRun- On Windows CMD Prompt:
gradlew bootRun- On Unix and Windows Powershell:
docker run --rm --network host -v "$(pwd):/usr/src/app" specmatic/enterprise test- On Windows CMD Prompt:
docker run --rm --network host -v "%cd%:/usr/src/app" specmatic/enterprise test