0.3.8 • Published 18 days ago

@backstage/plugin-graphiql v0.3.8

Weekly downloads
467
License
Apache-2.0
Repository
github
Last release
18 days ago

@backstage/plugin-graphiql

This plugin integrates GraphiQL as a tool to browse GraphiQL endpoints inside Backstage.

The purpose of the plugin is to provide a convenient way for developers to try out GraphQL queries in their own environment. By exposing GraphiQL as a plugin instead of a standalone app, it's possible to provide a preconfigured environment for engineers, and also tie into authentication providers already inside Backstage.

Getting Started

Installing the plugin

Start out by installing the plugin in your Backstage app:

yarn add @backstage/plugin-graphiql

Then add an entry to your App's plugins.ts to import the plugin.

The plugin registers a /graphiql route, which you can link to from the Sidebar if desired.

Adding GraphQL endpoints

For the plugin to function, you need to supply GraphQL endpoints through the GraphQLBrowse API, which is done by implementing the GraphQLBrowseApi exported by this plugin.

If all you need is a static list of endpoints, the plugin exports a GraphQLEndpoints class that implements the GraphQLBrowseApi for you. Here's and example of how you could expose two GraphQL endpoints in your App:

import {
  graphQlBrowseApiRef,
  GraphQLEndpoints,
} from '@backstage/plugin-graphiql';

// Implement the Graph QL browse API using a static list of endpoints
const graphQlBrowseApi = GraphQLEndpoints.from([
  // Use the .create function if all you need is a static URL and headers.
  GraphQLEndpoints.create({
    id: 'gitlab',
    title: 'GitLab',
    url: 'https://gitlab.com/api/graphql',
    // Optional extra headers
    headers: { Extra: 'Header' },
  }),
  {
    id: 'hooli-search',
    title: 'Hooli Search',
    // Custom fetch function, this one is equivalent to using GraphQLEndpoints.create()
    // with url set to https://internal.hooli.com/search
    fetcher: async (params: any) => {
      return fetch('https://internal.hooli.com/search', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(params),
      }).then(res => res.json());
    },
  },
]);

// ApiRegistry builder created somewhere in your App
const builder = ApiRegistry.builder();

// Add the instance to the API registry
builder.add(graphQlBrowseApiRef, graphQlBrowseApi);
0.3.8

20 days ago

0.3.7

23 days ago

0.3.7-next.1

1 month ago

0.3.7-next.0

1 month ago

0.3.6

1 month ago

0.3.5

2 months ago

0.3.4

2 months ago

0.3.4-next.2

2 months ago

0.3.4-next.1

2 months ago

0.3.4-next.0

2 months ago

0.3.3

3 months ago

0.3.3-next.3

3 months ago

0.3.3-next.2

3 months ago

0.3.3-next.1

3 months ago

0.3.3-next.0

4 months ago

0.3.2

4 months ago

0.3.2-next.2

4 months ago

0.3.2-next.1

4 months ago

0.3.2-next.0

5 months ago

0.3.1

5 months ago

0.3.1-next.4

5 months ago

0.3.1-next.3

5 months ago

0.3.1-next.2

5 months ago

0.3.1-next.0

6 months ago

0.3.1-next.1

6 months ago

0.2.53-next.0

10 months ago

0.3.0

6 months ago

0.2.52-next.2

10 months ago

0.2.52-next.1

10 months ago

0.2.55-next.2

7 months ago

0.2.55-next.1

7 months ago

0.2.55-next.0

8 months ago

0.3.0-next.2

6 months ago

0.3.0-next.1

6 months ago

0.3.0-next.0

7 months ago

0.2.54-next.0

9 months ago

0.2.54-next.1

8 months ago

0.2.54-next.2

8 months ago

0.2.54-next.3

8 months ago

0.2.52

10 months ago

0.2.55

7 months ago

0.2.54

8 months ago

0.2.53

9 months ago

0.2.52-next.0

11 months ago

0.2.51-next.2

11 months ago

0.2.51-next.3

11 months ago

0.2.51

11 months ago

0.2.51-next.0

12 months ago

0.2.51-next.1

12 months ago

0.2.50-next.0

1 year ago

0.2.50-next.1

1 year ago

0.2.50

12 months ago

0.2.49-next.3

1 year ago

0.2.49

1 year ago

0.2.48-next.0

1 year ago

0.2.48-next.1

1 year ago

0.2.48-next.2

1 year ago

0.2.49-next.2

1 year ago

0.2.49-next.1

1 year ago

0.2.49-next.0

1 year ago

0.2.48

1 year ago

0.2.47

1 year ago

0.2.46-next.2

1 year ago

0.2.46-next.1

1 year ago

0.2.47-next.0

1 year ago

0.2.47-next.1

1 year ago

0.2.46

1 year ago

0.2.46-next.0

1 year ago

0.2.44-next.4

1 year ago

0.2.44-next.1

1 year ago

0.2.43-next.1

2 years ago

0.2.44-next.0

1 year ago

0.2.44-next.3

1 year ago

0.2.44-next.2

1 year ago

0.2.43-next.0

2 years ago

0.2.45

1 year ago

0.2.44

1 year ago

0.2.43

1 year ago

0.2.42

2 years ago

0.2.42-next.2

2 years ago

0.2.42-next.1

2 years ago

0.2.42-next.0

2 years ago

0.2.41-next.0

2 years ago

0.2.41-next.1

2 years ago

0.2.41-next.2

2 years ago

0.2.41-next.3

2 years ago

0.2.41

2 years ago

0.2.38-next.1

2 years ago

0.2.38-next.0

2 years ago

0.2.39-next.1

2 years ago

0.2.39-next.0

2 years ago

0.2.39-next.3

2 years ago

0.2.39-next.2

2 years ago

0.2.40-next.1

2 years ago

0.2.40-next.0

2 years ago

0.2.40

2 years ago

0.2.39

2 years ago

0.2.38

2 years ago

0.2.37-next.0

2 years ago

0.2.37-next.1

2 years ago

0.2.37

2 years ago

0.2.34-next.0

2 years ago

0.2.36-next.2

2 years ago

0.2.36-next.1

2 years ago

0.2.36-next.0

2 years ago

0.2.36

2 years ago

0.2.35

2 years ago

0.2.34

2 years ago

0.2.33

2 years ago

0.2.30-next.0

2 years ago

0.2.28-next.0

2 years ago

0.2.27

2 years ago

0.2.26

2 years ago

0.2.25

2 years ago

0.2.24

2 years ago

0.2.23

2 years ago

0.2.30

2 years ago

0.2.32

2 years ago

0.2.31

2 years ago

0.2.29-next.0

2 years ago

0.2.29

2 years ago

0.2.28

2 years ago

0.2.22

2 years ago

0.2.21

2 years ago

0.2.20

3 years ago

0.2.19

3 years ago

0.2.18

3 years ago

0.2.17

3 years ago

0.2.16

3 years ago

0.2.15

3 years ago

0.2.14

3 years ago

0.2.13

3 years ago

0.2.12

3 years ago

0.2.11

3 years ago

0.2.10

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.1-alpha.26

4 years ago

0.1.1-alpha.25

4 years ago

0.1.1-alpha.24

4 years ago

0.1.1-alpha.23

4 years ago

0.1.1-alpha.22

4 years ago

0.1.1-alpha.21

4 years ago

0.1.1-alpha.20

4 years ago

0.1.1-alpha.19

4 years ago

0.1.1-alpha.18

4 years ago

0.1.1-alpha.17

4 years ago

0.1.1-alpha.16

4 years ago

0.1.1-alpha.15

4 years ago

0.1.1-alpha.14

4 years ago

0.1.1-alpha.13

4 years ago

0.1.1-alpha.11

4 years ago

0.1.1-alpha.10

4 years ago

0.1.1-alpha.12

4 years ago

0.1.1-alpha.9

4 years ago

0.1.1-alpha.8

4 years ago

0.1.1-alpha.7

4 years ago

0.1.1-alpha.6

4 years ago

0.1.1-alpha.5

4 years ago

0.1.1-alpha.4

4 years ago