innovixx

payload graphql view plugin

by innovixx
APIs & SDKs
v2
^2.0.4

Overview

Summary generated from the README

Adds a GraphQL view with an embedded GraphQL IDE to Payload collections and globals in the admin panel. It is registered in the plugins array and can be limited to chosen collection or global slugs, otherwise it applies to all. The GraphQL endpoint URL can be overridden. Built for Payload 2.x.

Features

  • Adds a GraphQL view with an IDE to collections
  • Adds the same view to globals
  • Restrict to specific collection or global slugs
  • Override the GraphQL endpoint URL
  • Exports TypeScript types for plugin options

Use cases

  • Test GraphQL queries against a collection without leaving the Payload admin
  • Let developers explore the GraphQL schema for globals while editing content

From the author

payload-graphql-view-plugin

Installation

npm i @innovixx/payload-graphql-view-plugin

5

Stars

0

Forks

1

Open Issues

2 years ago

Last Updated

33

Weekly Downloads

v0.1.4

npm Version

43.9 KB

Unpacked Size

4

Dependencies

GitHub stars

50 since Sep 6

Show data
GitHub stars by day (UTC)
DateStars
Dec 5, 20265
Dec 4, 20265
Dec 3, 20265
Dec 2, 20265
Dec 1, 20265
Nov 30, 20265
Nov 29, 20265
Nov 28, 20265
Nov 27, 20265
Nov 26, 20265
Nov 25, 20265
Nov 24, 20265
Nov 23, 20265
Nov 22, 20265
Nov 21, 20265
Nov 20, 20265
Nov 19, 20265
Nov 18, 20265
Nov 17, 20265
Nov 16, 20265
Nov 15, 20265
Nov 14, 20265
Nov 13, 20265
Nov 12, 20265
Nov 11, 20265
Nov 10, 20265
Nov 9, 20265
Nov 8, 20265
Nov 7, 20265
Nov 6, 20265
Nov 5, 20265
Nov 4, 20265
Nov 3, 20265
Nov 2, 20265
Nov 1, 20265
Oct 31, 20265
Oct 30, 20265
Oct 29, 20265
Oct 28, 20265
Oct 27, 20265
Oct 26, 20265
Oct 25, 20265
Oct 24, 20265
Oct 23, 20265
Oct 22, 20265
Oct 21, 20265
Oct 20, 20265
Oct 19, 20265
Oct 18, 20265
Oct 17, 20265
Oct 16, 20265
Oct 15, 20265
Oct 14, 20265
Oct 13, 20265
Oct 12, 20265
Oct 11, 20265
Oct 10, 20265
Oct 9, 20265
Oct 8, 20265
Oct 7, 20265
Oct 6, 20265
Oct 5, 20265
Oct 4, 20265
Oct 3, 20265
Oct 2, 20265
Oct 1, 20265
Sep 30, 20265
Sep 29, 20265
Sep 28, 20265
Sep 27, 20265
Sep 26, 20265
Sep 25, 20265
Sep 24, 20265
Sep 23, 20265
Sep 22, 20265
Sep 21, 20265
Sep 20, 20265
Sep 19, 20265
Sep 18, 20265
Sep 17, 20265
Sep 16, 20265
Sep 15, 20265
Sep 14, 20265
Sep 13, 20265
Sep 12, 20265
Sep 11, 20265
Sep 10, 20265
Sep 9, 20265
Sep 8, 20265
Sep 7, 20265
Sep 6, 20265
npm weekly downloads

34+25 since Sep 6

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 5, 202634
Dec 4, 202615
Dec 3, 202616
Dec 2, 202615
Dec 1, 20267
Nov 30, 202610
Nov 29, 202620
Nov 28, 202620
Nov 27, 202622
Nov 26, 202620
Nov 25, 202620
Nov 24, 202618
Nov 23, 202615
Nov 22, 20267
Nov 21, 20267
Nov 20, 20264
Nov 19, 20264
Nov 18, 202620
Nov 17, 202619
Nov 16, 202620
Nov 15, 202619
Nov 14, 202619
Nov 13, 202619
Nov 12, 202619
Nov 11, 20263
Nov 10, 202614
Nov 9, 202613
Nov 8, 202612
Nov 7, 202621
Nov 6, 202622
Nov 5, 202623
Nov 4, 202625
Nov 3, 202618
Nov 2, 202618
Nov 1, 202618
Oct 31, 20268
Oct 30, 20267
Oct 29, 20266
Oct 28, 20264
Oct 27, 20260
Oct 26, 202612
Oct 25, 202613
Oct 24, 202613
Oct 23, 202613
Oct 22, 202616
Oct 21, 202616
Oct 20, 202616
Oct 19, 20264
Oct 18, 20263
Oct 17, 20264
Oct 16, 20265
Oct 15, 20262
Oct 14, 20262
Oct 13, 20262
Oct 12, 20262
Oct 11, 20263
Oct 10, 20262
Oct 9, 20261
Oct 8, 20261
Oct 7, 20261
Oct 6, 20262
Oct 5, 20262
Oct 4, 20262
Oct 3, 20262
Oct 2, 20263
Oct 1, 20263
Sep 30, 20263
Sep 29, 20262
Sep 28, 20262
Sep 27, 20262
Sep 26, 20266
Sep 25, 20265
Sep 24, 20265
Sep 23, 20265
Sep 22, 20266
Sep 21, 202616
Sep 20, 202615
Sep 19, 202611
Sep 18, 202612
Sep 17, 202613
Sep 16, 202613
Sep 15, 202613
Sep 14, 20264
Sep 13, 20264
Sep 12, 20265
Sep 11, 20264
Sep 10, 20263
Sep 9, 20265
Sep 8, 20269
Sep 7, 20269
Sep 6, 20269

Each point is npm's rolling 7-day download count.

Health Score

23/100Poor

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/703617268-root.svg)](https://payloaddirectory.dev/plugins/703617268-root)
HTML
<a href="https://payloaddirectory.dev/plugins/703617268-root"><img src="https://payloaddirectory.dev/badge/703617268-root.svg" alt="Payload Directory"></a>
Updated Feb 18, 2024Created Oct 11, 2023Published Feb 18, 2024

README

Payload Graphql View Plugin

NPM

A plugin for Payload that adds a graphql view with a graphql IDE to collections and globals.

Core features:

  • add a graphql view to collections and globals

Installation

  yarn add @innovixx/payload-graphql-view-plugin
  # OR
  npm i @innovixx/payload-graphql-view-plugin

Basic Usage

In the plugins array of your Payload config, call the plugin with options:

import { buildConfig } from 'payload/config';
import GraphqlPlugin from '@innovixx/payload-graphql-view-plugin';

const config = buildConfig({
  collections: [
    {
      slug: 'pages',
      fields: []
    },
    {
      slug: 'media',
      upload: {
        staticDir: // path to your static directory,
      },
      fields: []
    }
  ],
  plugins: [
    GraphqlPlugin({
      collections: ['pages']
    })
  ]
});

export default config;

Options

  • collections : string[] | optional

    An array of collection slugs to add the Grapqhl view onto. If not provided, the Grapqhl view will be added to all collections.

  • globals : string[] | optional

    An array of global slugs to add the Grapqhl view onto. If not provided, the Grapqhl view will be added to all globals.

  • graphqlUrl : string | optional

    Override url to the graphql endpoint.

TypeScript

All types can be directly imported:

import {
  PluginConfig,
} from '@innovixx/payload-graphql-view-plugin/types';

Development

To actively develop or debug this plugin you can either work directly within the demo directory of this repo, or link your own project.

  1. Internal Demo

    This repo includes a fully working, self-seeding instance of Payload that installs the plugin directly from the source code. This is the easiest way to get started. To spin up this demo, follow these steps:

    1. First clone the repo
    2. Then, cd YOUR_PLUGIN_REPO && yarn && cd demo && yarn && yarn cleanDev
    3. Now open http://localhost:3000/admin in your browser
    4. Enter username [email protected] and password Pa$$w0rd!

    That's it! Changes made in ./src will be reflected in your demo. Keep in mind that the demo database is automatically seeded on every startup, any changes you make to the data get destroyed each time you reboot the app.

  2. Linked Project

    You can alternatively link your own project to the source code:

    1. First clone the repo
    2. Then, cd YOUR_PLUGIN_REPO && yarn && cd demo && cp env.example .env && yarn && yarn dev
    3. Now cd back into your own project and run, yarn link @innovixx/payload-graphql-view-plugin
    4. If this plugin using React in any way, continue to the next step. Otherwise skip to step 7.
    5. From your own project, cd node_modules/react && yarn link && cd ../react-dom && yarn link && cd ../../
    6. Then, cd YOUR_PLUGIN_REPO && yarn link react react-dom

    All set! You can now boot up your own project as normal, and your local copy of the plugin source code will be used. Keep in mind that changes to the source code require a rebuild, yarn build.

    You might also need to alias these modules in your Webpack config. To do this, open your project's Payload config and add the following:

    import { buildConfig } from "payload/config";
    
    export default buildConfig({
      admin: {
        webpack: (config) => ({
          ...config,
          resolve: {
            ...config.resolve,
            alias: {
              ...config.resolve.alias,
              react: path.join(__dirname, "../node_modules/react"),
              "react-dom": path.join(__dirname, "../node_modules/react-dom"),
              payload: path.join(__dirname, "../node_modules/payload"),
              "@innovixx/payload-graphql-view-plugin": path.join(
                __dirname,
                "../../payload/payload-graphql-view-plugin/src"
              ),
            },
          },
        }),
      },
    });
    

Similar plugins