Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
graphql-playground-html
Advanced tools
GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).
The graphql-playground-html npm package provides a way to embed GraphQL Playground, a powerful GraphQL IDE, into your web applications. It allows developers to interact with their GraphQL APIs through a user-friendly interface, making it easier to test queries, mutations, and subscriptions.
Embedding GraphQL Playground
This code sample demonstrates how to embed GraphQL Playground into an HTML page. It includes the necessary CSS and JavaScript files from a CDN and initializes the playground with a specified GraphQL endpoint.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>GraphQL Playground</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/graphql-playground-html@latest/build/static/css/index.css" />
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/npm/graphql-playground-html@latest/build/favicon.png" />
<script src="https://cdn.jsdelivr.net/npm/graphql-playground-html@latest/build/static/js/middleware.js"></script>
</head>
<body>
<div id="root"></div>
<script>
window.addEventListener('load', function (event) {
GraphQLPlayground.init(document.getElementById('root'), { endpoint: '/graphql' })
})
</script>
</body>
</html>
Customizing GraphQL Playground
This code sample shows how to customize the GraphQL Playground by setting various options such as the editor theme and cursor shape. These settings can be adjusted to fit the developer's preferences.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>GraphQL Playground</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/graphql-playground-html@latest/build/static/css/index.css" />
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/npm/graphql-playground-html@latest/build/favicon.png" />
<script src="https://cdn.jsdelivr.net/npm/graphql-playground-html@latest/build/static/js/middleware.js"></script>
</head>
<body>
<div id="root"></div>
<script>
window.addEventListener('load', function (event) {
GraphQLPlayground.init(document.getElementById('root'), {
endpoint: '/graphql',
settings: {
'editor.theme': 'dark',
'editor.cursorShape': 'line'
}
})
})
</script>
</body>
</html>
GraphiQL is another popular GraphQL IDE that provides a similar interface for testing and interacting with GraphQL APIs. It is highly customizable and can be embedded into web applications. Compared to graphql-playground-html, GraphiQL is more lightweight but may lack some of the advanced features and polish of GraphQL Playground.
Altair is a feature-rich GraphQL client that offers a wide range of functionalities, including query history, variable extraction, and more. It can be used as a standalone application or embedded into web applications. Altair provides a more extensive set of features compared to graphql-playground-html, making it suitable for more advanced use cases.
Apollo Server is a GraphQL server implementation that includes a built-in GraphQL Playground for testing queries and mutations. While it is primarily focused on serving GraphQL APIs, the included playground offers similar functionalities to graphql-playground-html. Apollo Server is a good choice if you need both a GraphQL server and an integrated playground.
This package is being used by the GraphQL Playground middlewares.
For local development, you can yarn link
this package, then use yarn link graphql-playground-html
in the
middleware you want to develop.
FAQs
GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).
The npm package graphql-playground-html receives a total of 49,330 weekly downloads. As such, graphql-playground-html popularity was classified as popular.
We found that graphql-playground-html demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.