🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

stepzen-graphiql

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stepzen-graphiql

Stepzen Graphiql Explorer

1.0.9
latest
npm
Version published
Weekly downloads
151
-13.71%
Maintainers
2
Weekly downloads
 
Created
Source

stepzen-graphiql

NPM JavaScript Style Guide

Install

npm install --save stepzen-graphiql

Basic Usage

import { GraphiQLExplorer } from "stepzen-graphiql";
import "stepzen-graphiql/style.css";

function App() {
  const config: GraphiQLConfig = {
    endpoint: "https://your-graphql-endpoint.com/graphql",
  };

  return <GraphiQLExplorer config={config} />;
}

Advanced Usage

You can use the GraphiQLExplorer component directly to customize behavior and layout, including:

Providing a custom GraphQL endpoint via config

Showing/hiding the explorer's URL tab

import { GraphiQLExplorer, GraphiQLConfig } from "stepzen-graphiql";
import "stepzen-graphiql/style.css";

function App() {
  const config: GraphiQLConfig = {
    endpoint: "https://your-graphql-endpoint.com/graphql",
    showExplorerHeader: true, // Enables the explorer's URL input tab with toggle
  };

  function fetchCostData(query: string) {
    console.log("Fetching cost data: " + query);
  }

  function queryCompleted(result: string) {
    console.log("Fetched data: " + result);
  }

  return (
    <GraphiQLExplorer
      config={config}
      onEditQuery={fetchCostData}
      onFetchResult={queryCompleted}
    >
    </GraphiQLExplorer>
  );
}

export default App;

Configuration

PropTypeDescription
endpointstringGraphQL endpoint to be used in the explorer
showExplorerHeaderbooleanToggles visibility of the URL tab with hide/show functionality
onEditQueryfunctionCallback triggered when the query is edited
onFetchResultfunctionCallback triggered when the query result is fetched

Keywords

stepzen-graphiql

FAQs

Package last updated on 13 Jun 2025

Did you know?

Socket

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.

Install

Related posts