Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files via upload #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 86 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,92 @@
# graphql-runner
# Environment Setup

To start you journey generate GQL queries, mutations and subscriptions with the popular tool `gqlg`:
After git clone repo, to ensure the script functions correctly, we need to:

1. Install nvm (Node Version Manager), which allows you to install and use different versions
of Node.js in an isolated environment.

```
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
```

2. Install the latest version of `Node.js`:


```
nvm install node
```

verify that everything is set up correctly:

```
nvm current
```

```
command -v nvm
```

3. Install dependencies. If you encounter an error, use the `--legacy-peer-deps` flag,
which will force npm to ignore peer dependency conflicts and install them anyway.

```
npm install --legacy-peer-deps
```

4. Install [gql-generator](https://www.npmjs.com/package/gql-generator)

```
sudo npm install gql-generator -g
```


Don’t forget to configure the Burp proxy to listen on all interfaces


# Configure script `scanner/index.js`

You need to change:

1. Set the required headers:

```
// authorization: 'Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.//',
// Cookie: '...//'
```

2. Set the GraphQL endpoint:

```
// Choose your target

const target = 'https://example.com/api/graphql';
```

3. Set the proxy address:

```
// process.env.GLOBAL_AGENT_HTTPS_PROXY="http://127.0.0.1:8080";
```

4. By default, the script processes the `mutations` folder. To switch to, for example, `queries`, replace the line with:

```
// Parse your schema with

const mutations = require('../gqlg/mutations');
```


# Usage

1. Place the schema.graphql file in the project’s root directory, which will be parsed:

```
gqlg --schemaFilePath ./schema.graphql --destDirPath ./gqlg --depthLimit 4
```

Then just code this beautiful script as you want and you are perfect.
2. To start, use the command:

```
node scanner/index.js
```