Coder Social home page Coder Social logo

graphql-load-testing's Introduction

Load Testing a GraphQL API using Artillery

This example shows you how to load test on a GraphQL API using Artillery.

Running the GraphQL server

This example runs a GraphQL server using Apollo Server and Prisma for data persistence. Prisma is configured to use PostgreSQL.

First, install the server dependencies:

npm install

Next, configure your PostgreSQL server connection string by setting the DATABASE_URL environment variable (either on the server or through the .env file). With the database created and configured, set up the required database tables by running the Prisma database migrations:

npx prisma migrate dev

After installing the dependencies and setting up the database, start the GraphQL server:

node app.js

This command will start the GraphQL API server listening at http://localhost:4000/. Once the server is up and running, you can explore the server using the Apollo Sandbox.

Running Artillery tests

This repo contains two test scripts ([tests/performance/graphql.yml] and [tests/performance/users.yml]) which runs a few end-to-end flows against the GraphQL server. Once the GraphQL server is up and running, execute the test scripts:

npm run test:graphql
npm run test:users

graphql-load-testing's People

Contributors

dennmart avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.