Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
@apollographql/graphql-playground-html
Advanced tools
GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).
@apollographql/graphql-playground-html is a package that provides a way to embed GraphQL Playground, an interactive, in-browser GraphQL IDE, into your web applications. It allows developers to test and document their GraphQL APIs with ease.
Embedding GraphQL Playground
This feature allows you to embed the GraphQL Playground into your web application. The code sample demonstrates how to include the necessary script and initialize the playground with a specified GraphQL endpoint.
<script src="https://cdn.jsdelivr.net/npm/@apollographql/graphql-playground-html@latest/build/static/js/middleware.js"></script>
<div id="playground"></div>
<script>
window.addEventListener('load', function (event) {
GraphQLPlayground.init(document.getElementById('playground'), {
endpoint: '/graphql'
})
})
</script>
Custom Configuration
This feature allows you to customize the configuration of the GraphQL Playground. The code sample shows how to set custom settings such as the editor theme and cursor shape.
<script src="https://cdn.jsdelivr.net/npm/@apollographql/graphql-playground-html@latest/build/static/js/middleware.js"></script>
<div id="playground"></div>
<script>
window.addEventListener('load', function (event) {
GraphQLPlayground.init(document.getElementById('playground'), {
endpoint: '/graphql',
settings: {
'editor.theme': 'dark',
'editor.cursorShape': 'line'
}
})
})
</script>
graphql-playground is a standalone GraphQL IDE that can be used as a desktop application or embedded in web applications. It offers similar functionalities to @apollographql/graphql-playground-html, including an interactive interface for testing and documenting GraphQL APIs. However, it is more versatile as it can be used both as a desktop app and an embedded tool.
graphiql is another popular in-browser IDE for exploring GraphQL. It provides a simple and clean interface for running queries and mutations against a GraphQL endpoint. While it offers similar core functionalities, graphiql is known for its extensibility and integration capabilities with various GraphQL tools and libraries.
altair is a feature-rich GraphQL client that provides an interactive interface for testing GraphQL queries and mutations. It offers advanced features such as query history, environment management, and support for multiple tabs. Compared to @apollographql/graphql-playground-html, altair provides a more comprehensive set of tools for managing and testing GraphQL APIs.
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 @apollographql/graphql-playground-html receives a total of 1,159,768 weekly downloads. As such, @apollographql/graphql-playground-html popularity was classified as popular.
We found that @apollographql/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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.