SWAPI GraphQL Wrapper Schema
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
:
;;; const app = ; app; app;
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.