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

Sweep (slow): GraphQL Support #45

Open
4 tasks done
srikanthlogic opened this issue Sep 26, 2023 · 1 comment · May be fixed by #47 or #48
Open
4 tasks done

Sweep (slow): GraphQL Support #45

srikanthlogic opened this issue Sep 26, 2023 · 1 comment · May be fixed by #47 or #48
Labels
sweep Assigns Sweep to an issue or pull request.

Comments

@srikanthlogic
Copy link
Owner

srikanthlogic commented Sep 26, 2023

Details

Feature: Support graphql endpoint using openapi-to-graphql and raise a pull request into dev branch

Checklist
  • package.json ✅ Commit c5649b5
  • lib/graphql.js ✅ Commit a7e0357
  • server.js ✅ Commit 2570161
  • README.md ❌ Failed
@srikanthlogic srikanthlogic added the sweep Assigns Sweep to an issue or pull request. label Sep 26, 2023
@sweep-ai
Copy link

sweep-ai bot commented Sep 26, 2023

Here's the PR! #48.

⚡ Sweep Free Trial: I'm creating this ticket using GPT-4. You have 1 GPT-4 tickets left for the month and 1 for the day. For more GPT-4 tickets, visit [our payment portal.](https://buy.stripe.com/6oE5npbGVbhC97afZ4)

Actions (click)

  • ↻ Restart Sweep

Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description.

# Google Play API
![GitHub tag (latest SemVer pre-release)](https://img.shields.io/github/v/tag/srikanthlogic/google-play-api?include_prereleases&label=version) [![Newman Run](https://github.com/srikanthlogic/google-play-api/actions/workflows/newman.yml/badge.svg)](https://github.com/srikanthlogic/google-play-api/actions/workflows/newman.yml) [![API Documentation](https://img.shields.io/badge/api-documentation-brightgreen)](https://gplayapi.cashlessconsumer.in/) [![Deploy](https://button.deta.dev/1/svg)](https://deta.space/discovery/@cashlessconsumer/googleplayapi)
Google Play API is a REST API wrapper originally built on top of [google-play-scraper](https://github.com/facundoolano/google-play-scraper) by [Facundoolano](https://github.com/facundoolano) to fetch metadata from [Google Play](https://en.wikipedia.org/wiki/Google_Play). This repository extends it and adds additional endpoints.
## API Server
The API Server is built on ExpressJS and self contains API documentation.
To run locally:
* Clone the repository and run
* `npm install`
* `npm run generateoas` - Generates the OpenAPI specification
* `npm start`
### Deployments
The API Server can be installed as a [Deta app](https://deta.space/discovery/@cashlessconsumer/googleplayapi).
### Roadmap
* [ ] Expose more endpoints helping towards archiving.
* [ ] Support Global options
* [X] Deta Support. [#34](https://github.com/srikanthlogic/google-play-api/issues/34)
* [X] Support Lists [#36](https://github.com/srikanthlogic/google-play-api/issues/36)
* [X] Support privacy friendly reviews extraction [#40](https://github.com/srikanthlogic/google-play-api/issues/40)
## Disclaimer

developer: {
devId: app.developer,
url: buildUrl(req, 'developers/' + qs.escape(app.developer))
},
categories: buildUrl(req, 'categories/')
});
const buildUrl = (req, subpath) =>
req.protocol + '://' + path.join(req.get('host'), req.baseUrl, subpath);
/* App search */
router.get('/apps/', function (req, res, next) {
if (!req.query.q) {
return next();
}
const opts = Object.assign({ term: req.query.q }, req.query);
gplay.search(opts)
.then((apps) => apps.map(cleanUrls(req)))
.then(toList)
.then(res.json.bind(res))
.catch(next);
});
/* Search suggest */
router.get('/apps/', function (req, res, next) {
if (!req.query.suggest) {
return next();
}
const toJSON = (term) => ({
term,
url: buildUrl(req, '/apps/') + '?' + qs.stringify({ q: term })
});
gplay.suggest({ term: req.query.suggest })
.then((terms) => terms.map(toJSON))
.then(toList)
.then(res.json.bind(res))
.catch(next);
});
/* App list */
router.get('/apps/', function (req, res, next) {
function paginate(apps) {
const num = parseInt(req.query.num || '60');
const start = parseInt(req.query.start || '0');
if (start - num >= 0) {
req.query.start = start - num;
apps.prev = buildUrl(req, '/apps/') + '?' + qs.stringify(req.query);
}
if (start + num <= 500) {
req.query.start = start + num;
apps.next = buildUrl(req, '/apps/') + '?' + qs.stringify(req.query);
}
return apps;
}
gplay.list(req.query)
.then((apps) => apps.map(cleanUrls(req)))
.then(toList).then(paginate)
.then(res.json.bind(res))
.catch(next);
});
/* App detail */
router.get('/apps/:appId', function (req, res, next) {
const opts = Object.assign({ appId: req.params.appId }, req.query);
gplay.app(opts)
.then(cleanUrls(req))
.then(res.json.bind(res))
.catch(next);
});
/* Similar apps */
router.get('/apps/:appId/similar', function (req, res, next) {
const opts = Object.assign({ appId: req.params.appId }, req.query);
gplay.similar(opts)
.then((apps) => apps.map(cleanUrls(req)))
.then(toList)
.then(res.json.bind(res))
.catch(next);
});
/* Data Safety */
router.get('/apps/:appId/datasafety', function (req, res, next) {
const opts = Object.assign({ appId: req.params.appId }, req.query);
gplay.datasafety(opts)
.then(toList)
.then(res.json.bind(res))
.catch(next);
});
/* App permissions */
router.get('/apps/:appId/permissions', function (req, res, next) {
const opts = Object.assign({ appId: req.params.appId }, req.query);
gplay.permissions(opts)
.then(toList)
.then(res.json.bind(res))
.catch(next);
});
/* App reviews */
router.get('/apps/:appId/reviews', function (req, res, next) {
const opts = Object.assign({ appId: req.params.appId }, req.query);
const includeUserData = req.query.userdata === 'true';
const includeReplies = req.query.replies == 'true'
const processReviews = (reviews, includeUserData, includeReplies) => {
const sanitizeReplyText = (text, userName) => {
const userNameParts = userName.split(' ');
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
const userNamePatterns = userNameParts.map(part => new RegExp(escapeRegExp(part), 'gi'));
return userNamePatterns.reduce(
(sanitizedText, pattern) => sanitizedText.replace(pattern, '[REDACTED_USER]'),
text
);
};
if (!includeUserData) {
reviews.data = reviews.data.map(review => {
const { userName, userImage, replyText, url, ...rest } = review;
rest.date = rest.date.split('T')[0];
if (!includeReplies) {
delete rest.replyText;
delete rest.replyDate;
} else if (includeReplies && replyText) {
const sanitizedReplyText = sanitizeReplyText(replyText, userName);
rest.replyText = sanitizedReplyText;
}
return rest;
});
} else {
if (!includeReplies) {
reviews.data = reviews.data.map(review => {
const { replyText, replyDate, url, ...rest } = review;
rest.date = rest.date.split('T')[0];
return rest;
});
}
else {
reviews.data = reviews.data.map(review => {
const { url, ...rest } = review;
rest.date = rest.date.split('T')[0];
return rest;
});
}
}
return reviews;
};
// Check if nextPaginationToken is present and not null
if (req.query.nextPaginationToken !== null) {
opts.paginate = true;
opts.nextPaginationToken = req.query.nextPaginationToken;
}
// Sort criteria - Helpful, Most rated, and Newest reviews
// https://github.com/facundoolano/google-play-scraper/blob/89202849f6054f6ac64790a385abc3c18ae98df1/lib/constants.js#L69C7-L69C7
opts.sort = req.query.sort === 'helpful' ? 1 : req.query.sort === 'rated' ? 3 : 2;
gplay.reviews(opts)
.then(reviews => processReviews(reviews, includeUserData, includeReplies))
.then(toList)
.then(res.json.bind(res))
.catch(next);
});
/* Apps by developer */
router.get('/developers/:devId/', function (req, res, next) {
const opts = Object.assign({ devId: req.params.devId }, req.query);
gplay.developer(opts)
.then((apps) => apps.map(cleanUrls(req)))
.then((apps) => ({
devId: req.params.devId,
apps
}))
.then(res.json.bind(res))
.catch(next);
});
/* Developer list (not supported) */
router.get('/developers/', (req, res) =>
res.status(400).json({
message: 'Please specify a developer id.',
example: buildUrl(req, '/developers/' + qs.escape('Wikimedia Foundation'))
}));
/* List of apps by category and collection */
router.get('/lists/', function (req, res, next) {
const opts = Object.assign({ term: req.query.q }, req.query);
if (!req.query.category || !req.query.collection) {
return res.status(400).json({ message: 'Both category and collection parameters are required.' });
}
gplay.list(opts)
.then((apps) => apps.map(cleanUrls(req)))
.then(toList)
.then(res.json.bind(res))
.catch(next);
});
/* Category list */
router.get('/categories/', async (req, res, next) => {
try {
res.json(Object.keys(gplay.category));
} catch (error) {
next(error); // Pass the error to Express's error-handling middleware
}
});
function anonymizeReplyText(replyText, userName) {
const userPlaceholder = '<<USER>>';
return replyText.replace(new RegExp(userName, 'g'), userPlaceholder);
}
function errorHandler(err, req, res, next) {
res.status(400).json({ message: err.message });
next();
}
router.use(errorHandler);

v: 0
icon: ./assets/icon.png
micros:
- name: nodejs-app
src: .
engine: nodejs16
primary: true
commands:
- npm run generateoas

{
"name": "google-play-api",
"version": "1.5.0",
"description": "turn google play scraper into a RESTful API",
"main": "server.js",
"type": "module",
"scripts": {
"test": "node --es-module-specifier-resolution=node test.js",
"generateoas": "p2o ./PostmanCollections/GooglePlayAPI.postman_collection.json -o ./openapi/options.json -f ./openapi/swagger.json",
"start": "node server.js"
},
"author": "Facundo Olano",
"license": "ISC",
"repository": {
"type": "git",
"url": "https://github.com/srikanthlogic/google-play-api.git"
},
"dependencies": {
"express": "^4.18.2",
"google-play-scraper": "^10.0.0",
"npm-check-updates": "^16.14.4",
"postman-to-openapi": "^3.0.1",
"swagger-ui-express": "^5.0.0"
},
"devDependencies": {
"eslint": "^8.49.0",
"eslint-config-semistandard": "^17.0.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-standard": "^5.0.0",
"newman": "^5.3.2",
"newman-reporter-htmlextra": "^1.22.11"
}

google-play-api/LICENSE

Lines 1 to 20 in bdb6171

MIT License
Copyright (c) 2017 LambdaClass
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE


Step 2: ⌨️ Coding

• Add `"openapi-to-graphql": "^2.2.0"` to the `dependencies` object.
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.16.0...
⡿ Downloading Trunk 1.16.0...
⢿ Downloading Trunk 1.16.0...
⣻ Downloading Trunk 1.16.0...
⣽ Downloading Trunk 1.16.0...
⣾ Downloading Trunk 1.16.0...
⣷ Downloading Trunk 1.16.0...
⣯ Downloading Trunk 1.16.0...
⣟ Downloading Trunk 1.16.0...
⡿ Downloading Trunk 1.16.0...
⢿ Downloading Trunk 1.16.0...
⣻ Downloading Trunk 1.16.0...
⣽ Downloading Trunk 1.16.0...
⣾ Downloading Trunk 1.16.0...
✔ Downloading Trunk 1.16.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done



























✔ 14 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.26 (4 github-workflow files)
  checkov 2.4.9 (1 docker, 6 json, 10 yaml files)
  eslint 8.50.0 (3 javascript files)
  git-diff-check (30 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  markdownlint 0.37.0 (2 markdown files) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (3 javascript, 5 json, 2 markdown, 10 yaml files)
  taplo 0.8.1 (2 toml files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 10 yaml files)
  trufflehog 3.57.0 (31 files)
  yamllint 1.32.0 (10 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt package.json 2/3 ✓
Checked 1 file
✔ No issues
trunk check --fix package.json 3/3 ✓


































































































































































































































































Checked 1 file
✔ No issues
  • lib/graphql.js ✅ Commit a7e0357
• Import the necessary libraries: `import { createGraphQLSchema } from 'openapi-to-graphql'; import { graphqlHTTP } from 'express-graphql'; import fs from 'fs'; import path from 'path';` • Load the OpenAPI specification from the `./openapi/swagger.json` file. • Use the `createGraphQLSchema` function from `openapi-to-graphql` to convert the OpenAPI specification to a GraphQL schema. • Export a function that takes an Express app as an argument and uses the `graphqlHTTP` function from `express-graphql` to serve GraphQL requests on the `/graphql` endpoint.
Sandbox Execution Logs
trunk init 1/31 ✓
⡿ Downloading Trunk 1.16.0...
⡿ Downloading Trunk 1.16.0...
⢿ Downloading Trunk 1.16.0...
⣻ Downloading Trunk 1.16.0...
⣽ Downloading Trunk 1.16.0...
⣾ Downloading Trunk 1.16.0...
⣷ Downloading Trunk 1.16.0...
⣯ Downloading Trunk 1.16.0...
⣟ Downloading Trunk 1.16.0...
⡿ Downloading Trunk 1.16.0...
⢿ Downloading Trunk 1.16.0...
⣻ Downloading Trunk 1.16.0...
⣽ Downloading Trunk 1.16.0...
⣾ Downloading Trunk 1.16.0...
✔ Downloading Trunk 1.16.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done






























✔ 14 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.26 (4 github-workflow files)
  checkov 2.4.9 (1 docker, 6 json, 10 yaml files)
  eslint 8.50.0 (4 javascript files)
  git-diff-check (31 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  markdownlint 0.37.0 (2 markdown files) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (4 javascript, 5 json, 2 markdown, 10 yaml files)
  taplo 0.8.1 (2 toml files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 10 yaml files)
  trufflehog 3.57.0 (32 files)
  yamllint 1.32.0 (10 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt lib/graphql.js 2/31 ✓
 ✔ Formatted lib/graphql.js
Re-checking autofixed files...




Checked 1 file
✔ No issues
trunk check --fix lib/graphql.js 3/31 ❌ (`1`)






  FAILURES  
 eslint  lib/graphql.js  .trunk/out/VWM46.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install` 
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure
trunk fmt lib/graphql.js 4/31 ✓
 ✔ Formatted lib/graphql.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix lib/graphql.js 5/31 ❌ (`1`)
  FAILURES  
 eslint  lib/graphql.js  .trunk/out/syerL.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install` 
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure
trunk fmt lib/graphql.js 6/31 ✓
 ✔ Formatted lib/graphql.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix lib/graphql.js 7/31 ❌ (`1`)
  FAILURES  
 eslint  lib/graphql.js  .trunk/out/qUm27.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install` 
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure
trunk fmt lib/graphql.js 8/31 ✓
 ✔ Formatted lib/graphql.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix lib/graphql.js 9/31 ❌ (`1`)

  FAILURES  
 eslint  lib/graphql.js  .trunk/out/spI7S.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install` 
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure
trunk fmt lib/graphql.js 10/31 ✓
 ✔ Formatted lib/graphql.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix lib/graphql.js 11/31 ❌ (`1`)
  FAILURES  
 eslint  lib/graphql.js  .trunk/out/kzHdM.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install` 
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure
trunk fmt lib/graphql.js 12/31 ✓
 ✔ Formatted lib/graphql.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix lib/graphql.js 13/31 ❌ (`1`)
  FAILURES  
 eslint  lib/graphql.js  .trunk/out/QUAZA.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install` 
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure
trunk fmt lib/graphql.js 14/31 ✓
 ✔ Formatted lib/graphql.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix lib/graphql.js 15/31 ❌ (`1`)
  FAILURES  
 eslint  lib/graphql.js  .trunk/out/RQiGy.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install` 
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure
trunk fmt lib/graphql.js 16/31 ✓
 ✔ Formatted lib/graphql.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix lib/graphql.js 17/31 ❌ (`1`)
  FAILURES  
 eslint  lib/graphql.js  .trunk/out/dKwXa.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install` 
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure
trunk fmt lib/graphql.js 18/31 ✓
 ✔ Formatted lib/graphql.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix lib/graphql.js 19/31 ❌ (`1`)
  FAILURES  
 eslint  lib/graphql.js  .trunk/out/9d3Z4.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install` 
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure
trunk fmt lib/graphql.js 20/31 ✓
 ✔ Formatted lib/graphql.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix lib/graphql.js 21/31 ❌ (`1`)
  FAILURES  
 eslint  lib/graphql.js  .trunk/out/tZWl5.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install` 
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure
trunk fmt lib/graphql.js 22/31 ✓
 ✔ Formatted lib/graphql.js
Re-checking autofixed files...




Checked 1 file
✔ No issues
trunk check --fix lib/graphql.js 23/31 ❌ (`1`)
  FAILURES  
 eslint  lib/graphql.js  .trunk/out/KJvIQ.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install` 
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure
trunk fmt lib/graphql.js 24/31 ✓
 ✔ Formatted lib/graphql.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix lib/graphql.js 25/31 ❌ (`1`)
  FAILURES  
 eslint  lib/graphql.js  .trunk/out/iTnH1.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install` 
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure
trunk fmt lib/graphql.js 26/31 ✓
 ✔ Formatted lib/graphql.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix lib/graphql.js 27/31 ❌ (`1`)


  FAILURES  
 eslint  lib/graphql.js  .trunk/out/d8SSS.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install` 
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure
trunk fmt lib/graphql.js 28/31 ✓
 ✔ Formatted lib/graphql.js
Re-checking autofixed files...




Checked 1 file
✔ No issues
trunk check --fix lib/graphql.js 29/31 ❌ (`1`)
  FAILURES  
 eslint  lib/graphql.js  .trunk/out/RwzoJ.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install` 
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure
trunk fmt lib/graphql.js 30/31 ✓
 ✔ Formatted lib/graphql.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix lib/graphql.js 31/31 ❌ (`1`)
  FAILURES  
 eslint  lib/graphql.js  .trunk/out/iFuUl.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install` 
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure
• Import the function exported by `lib/graphql.js`. • Call the imported function with the Express app as an argument.
Sandbox Execution Logs
trunk init 1/31 ✓
⡿ Downloading Trunk 1.16.0...
⡿ Downloading Trunk 1.16.0...
⢿ Downloading Trunk 1.16.0...
⣻ Downloading Trunk 1.16.0...
⣽ Downloading Trunk 1.16.0...
⣾ Downloading Trunk 1.16.0...
⣷ Downloading Trunk 1.16.0...
⣯ Downloading Trunk 1.16.0...
⣟ Downloading Trunk 1.16.0...
⡿ Downloading Trunk 1.16.0...
⢿ Downloading Trunk 1.16.0...
⣻ Downloading Trunk 1.16.0...
⣽ Downloading Trunk 1.16.0...
✔ Downloading Trunk 1.16.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

























✔ 14 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.26 (4 github-workflow files)
  checkov 2.4.9 (1 docker, 6 json, 10 yaml files)
  eslint 8.50.0 (3 javascript files)
  git-diff-check (30 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  markdownlint 0.37.0 (2 markdown files) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (3 javascript, 5 json, 2 markdown, 10 yaml files)
  taplo 0.8.1 (2 toml files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 10 yaml files)
  trufflehog 3.57.0 (31 files)
  yamllint 1.32.0 (10 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt server.js 2/31 ✓
 ✔ Formatted server.js
Re-checking autofixed files...




Checked 1 file
✔ No issues
trunk check --fix server.js 3/31 ❌ (`1`)














  FAILURES  
 eslint  server.js  .trunk/out/d5YKF.yaml
 eslint  server.js  .trunk/out/piwEy.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install`      
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
trunk fmt server.js 4/31 ✓
 ✔ Formatted server.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix server.js 5/31 ❌ (`1`)

  FAILURES  
 eslint  server.js  .trunk/out/0NUYa.yaml
 eslint  server.js  .trunk/out/aI8T5.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install`      
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
trunk fmt server.js 6/31 ✓
 ✔ Formatted server.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix server.js 7/31 ❌ (`1`)

  FAILURES  
 eslint  server.js  .trunk/out/VxlqB.yaml
 eslint  server.js  .trunk/out/M9N6H.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install`      
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
trunk fmt server.js 8/31 ✓
 ✔ Formatted server.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix server.js 9/31 ❌ (`1`)

  FAILURES  
 eslint  server.js  .trunk/out/ivhGu.yaml
 eslint  server.js  .trunk/out/C656H.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install`      
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
trunk fmt server.js 10/31 ✓
 ✔ Formatted server.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix server.js 11/31 ❌ (`1`)

  FAILURES  
 eslint  server.js  .trunk/out/UBO2a.yaml
 eslint  server.js  .trunk/out/VRMMb.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install`      
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
trunk fmt server.js 12/31 ✓
 ✔ Formatted server.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix server.js 13/31 ❌ (`1`)

  FAILURES  
 eslint  server.js  .trunk/out/Rp32H.yaml
 eslint  server.js  .trunk/out/crOiW.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install`      
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
trunk fmt server.js 14/31 ✓

 ✔ Formatted server.js
Re-checking autofixed files...




Checked 1 file
✔ No issues
trunk check --fix server.js 15/31 ❌ (`1`)





  FAILURES  
 eslint  server.js  .trunk/out/3LzJE.yaml
 eslint  server.js  .trunk/out/2R8Ur.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install`      
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
trunk fmt server.js 16/31 ✓
 ✔ Formatted server.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix server.js 17/31 ❌ (`1`)

  FAILURES  
 eslint  server.js  .trunk/out/Lr6bZ.yaml
 eslint  server.js  .trunk/out/iDEoU.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install`      
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
trunk fmt server.js 18/31 ✓
 ✔ Formatted server.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix server.js 19/31 ❌ (`1`)

  FAILURES  
 eslint  server.js  .trunk/out/rHM9F.yaml
 eslint  server.js  .trunk/out/D0FOQ.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install`      
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
trunk fmt server.js 20/31 ✓
 ✔ Formatted server.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix server.js 21/31 ❌ (`1`)

  FAILURES  
 eslint  server.js  .trunk/out/FE3my.yaml
 eslint  server.js  .trunk/out/oHKbP.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install`      
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
trunk fmt server.js 22/31 ✓
 ✔ Formatted server.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix server.js 23/31 ❌ (`1`)

  FAILURES  
 eslint  server.js  .trunk/out/526b7.yaml
 eslint  server.js  .trunk/out/V1fcj.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install`      
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
trunk fmt server.js 24/31 ✓
 ✔ Formatted server.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix server.js 25/31 ❌ (`1`)

  FAILURES  
 eslint  server.js  .trunk/out/7WwSw.yaml
 eslint  server.js  .trunk/out/mwZgo.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install`      
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
trunk fmt server.js 26/31 ✓
 ✔ Formatted server.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix server.js 27/31 ❌ (`1`)

  FAILURES  
 eslint  server.js  .trunk/out/gPeWf.yaml
 eslint  server.js  .trunk/out/Hf8VQ.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install`      
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
trunk fmt server.js 28/31 ✓
 ✔ Formatted server.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix server.js 29/31 ❌ (`1`)

  FAILURES  
 eslint  server.js  .trunk/out/CbRLF.yaml
 eslint  server.js  .trunk/out/G1wQc.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install`      
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
trunk fmt server.js 30/31 ✓
 ✔ Formatted server.js
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix server.js 31/31 ❌ (`1`)

  FAILURES  
 eslint  server.js  .trunk/out/DYWF6.yaml
 eslint  server.js  .trunk/out/I9Nu9.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install`      
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
  • README.md ❌ Failed
• Add a new section, "GraphQL Server", that documents the new `/graphql` endpoint and explains how to send GraphQL requests to it.

Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/graphql-support.

.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request.
Join Our Discord

@srikanthlogic srikanthlogic changed the title Sweep (slow): Sweep (slow): GraphQL Support Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Assigns Sweep to an issue or pull request.
Projects
None yet
1 participant