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

[proof of work] feat(keystone): change graphql-playground to GraphiQL #5386

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Alllex202
Copy link
Contributor

No description provided.

Copy link

sonarcloud bot commented Oct 23, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
3 Security Hotspots

See analysis details on SonarCloud

new GraphQLApp({
apollo: {
formatError: safeApolloErrorFormatter,
debug: IS_ENABLE_APOLLO_DEBUG,
introspection: IS_ENABLE_DANGEROUS_GRAPHQL_PLAYGROUND,
playground: IS_ENABLE_DANGEROUS_GRAPHQL_PLAYGROUND,
playground: false,
Copy link
Member

@sitozzz sitozzz Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure but playground: false might be default

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Playground - __REPLACE_TO_YOUR_SERVER_URL__</title>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<title>Playground - __REPLACE_TO_YOUR_SERVER_URL__</title>
<title>Playground</title>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or even condo playground)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point here is to be able to differentiate between sandbox tabs of different applications.
This is exactly how it works for us now.
However, we can forget about this moment)

<script crossorigin src="https://unpkg.com/react-dom/umd/react-dom.production.min.js"></script>
<script crossorigin src="https://unpkg.com/graphiql/graphiql.min.js"></script>
<script>
const apiPath = '__REPLACE_TO_YOUR_API_PATH__'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not looking good)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, I found the reason below

Copy link
Contributor Author

@Alllex202 Alllex202 Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to add a library for generating templates, but we already use nunjucks - I'll try it

headers: {
'Content-Type': 'application/json',
},
credentials: 'omit',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment we con setup this during front-end. Our partners can use their own tokens

async prepareMiddleware () {
// nosemrep: javascript.express.security.audit.express-check-csurf-middleware-usage.express-check-csurf-middleware-usage
const app = express()
app.get(this._graphiqlPath, (req, res) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be we need to move it to another URL?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants