parse-community / parse-server

Parse Server for Node.js / Express
https://parseplatform.org
Apache License 2.0
20.7k stars 4.76k forks source link

fix: GraphQL Playground HTML #9058

Closed Tyrese-FullStackGenius closed 3 months ago

Tyrese-FullStackGenius commented 3 months ago

Pull Request

Fixed double quoting issue with "${JSON.stringify()}".

Issue

https://github.com/parse-community/parse-server/issues/9057

Closes: https://github.com/parse-community/parse-server/issues/9057

Approach

Remove quotes outside JSON.stringify()

parse-github-assistant[bot] commented 3 months ago

I will reformat the title to use the proper commit message syntax.

parse-github-assistant[bot] commented 3 months ago

Thanks for opening this pull request!

mtrezza commented 3 months ago

Is it possible to add a test for this?

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.78%. Comparing base (33c06b2) to head (389b1f0). Report is 1 commits behind head on alpha.

:exclamation: Current head 389b1f0 differs from pull request most recent head 16f642c. Consider uploading reports for the commit 16f642c to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## alpha #9058 +/- ## ========================================== + Coverage 84.95% 93.78% +8.83% ========================================== Files 186 186 Lines 14687 14687 ========================================== + Hits 12477 13774 +1297 + Misses 2210 913 -1297 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Tyrese-FullStackGenius commented 3 months ago

Is it possible to add a test for this?

it's frontend bug, so I think you have to run the server to test.

mtrezza commented 3 months ago

Which server are you referring to?

Tyrese-FullStackGenius commented 3 months ago

parse-server:7.0.0

mtrezza commented 3 months ago

This is parse sever. Running it is part of the testing.

Tyrese-FullStackGenius commented 3 months ago

understand, this is server start code:

const express = require("express");
const { ParseServer, ParseGraphQLServer } = require("parse-server");

const app = express();

const parseServer = new ParseServer({
  databaseURI:
    "mongodb+srv://tyrese3915:<password>@cluster0.xksqcbp.mongodb.net/parse-test",
  appId: "tyrese-app-1",
  javaScriptKey: "tyrese-secret-javascript-key",
  masterKey: "tyrese-secret-master-key",
  serverURL: "http://localhost:1337/parse",
  publicServerURL: "http://localhost:1337/parse",
});

const parseGraphQLServer = new ParseGraphQLServer(parseServer, {
  graphQLPath: "/graphql",
  playgroundPath: "/playground",
});

app.use("/parse", parseServer.app); // (Optional) Mounts the REST API
parseGraphQLServer.applyGraphQL(app); // Mounts the GraphQL API
parseGraphQLServer.applyPlayground(app); // (Optional) Mounts the GraphQL Playground - do NOT use in Production

parseServer
  .start()
  .then((res) => {
    app.listen(1337, () => {
      console.log("REST API running on http://localhost:1337/parse");
      console.log("GraphQL API running on http://localhost:1337/graphql");
      console.log(
        "GraphQL Playground running on http://localhost:1337/playground",
      );
    });
  })
  .catch((err) => {
    console.error(err);
  });
mtrezza commented 3 months ago

If you are familiar with testing frameworks in nodejs / js it should be easy for you to add. You could just take a look at the existing tests and add one for this bug.

Note that you may have exposed your DB access credentials in the comment above.

Tyrese-FullStackGenius commented 3 months ago

where is test code example?

mtrezza commented 3 months ago

In /specs

Tyrese-FullStackGenius commented 3 months ago

ok

Tyrese-FullStackGenius commented 3 months ago

@mtrezza I added test code to check render using puppeteer, and tested with that.