0.2.4 • Published 4 years ago

swapi-graphql-schema v0.2.4

Weekly downloads
9
License
BSD-3-Clause
Repository
github
Last release
4 years ago

SWAPI GraphQL Wrapper Schema

npm

This is a fork of the official Star Wars GraphQL API repo. This fork is necessary because of the following problems with that repo's npm package (swapi-graphql):

  • The published package has not been updated in a long time and does not track the repo's current code.
  • The schema it exports is unusable because it has a direct dependency on graphql, which leads to "multiple instances of GraphQL found" error messages.
  • Its postinstall hook causes installation with Yarn v2 to fail, probably because of Plug-n-Play.

This fork publishes a package called swapi-graphql-schema whose default export is the GraphQL schema.

Installation

npm install swapi-graphql-schema or yarn install swapi-graphql-schema.

Usage

This is typical usage with express-graphql:

import express from "express";
import graphqlHTTP from "express-graphql";
import schema from "swapi-graphql-schema";

const app = express();

app.use(
  "/graphql",
  graphqlHTTP({
    schema,
  })
);

app.listen(5000);

Publish

This repo uses go-task as the task runner.

  • Run task npm-auth to log in to npm. This only needs to be run once and your npm credentials will be stored in a local Docker volume.
  • Run task publish to publish the package.
0.2.4

4 years ago

0.2.3

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.2.2

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago