gakimball / prismic-graphql

Unfinished GraphQL API for Prismic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't Use This.

Before Prismic released its own GraphQL API, I started building this thing to learn GraphQL. It's unfinished, and not needed now that there's an official API.

prismic-graphql

GraphQL schema generator for Prismic

Usage

const express = require('express');
const expressGraphQL = require('express-graphql');
const prismicGraphQL = require('prismic-graphql');

const app = express();

prismicGraphQL('path/to/schemas').then(schema => {
  app.use('/graphql', expressGraphQL({
    schema,
    graphiql: true
  }));

  app.listen(4000);
});

API

prismicGraphQL(folder)

Create a GraphQL schema from a folder containing Prismic JSON schemas.

  • param (String): Path to folder.

Returns a Promise containing a GraphQL schema.

Local Development

git clone https://github.com/gakimball/prismic-graphql
cd prismic-graphql
npm install
npm test

License

MIT © Geoff Kimball

About

Unfinished GraphQL API for Prismic

License:MIT License


Languages

Language:JavaScript 100.0%