@parse-graphql/schema

0.4.1 • Public • Published

Parse GraphQL Schema npm (scoped) CircleCI Parse GraphQL Logo

WIP

Project Goals

The goal of this project is to generate a GraphQL schema that supports most of the Parse API, without having much support for customization in this library. A lot of customization can be done on the parse-server side, or the generated types can be imported and you can add them to your own custom schema.

Install

yarn add @parse-graphql/schema

or

npm install --save @parse-graphql/schema

Usage

This library can be used directly and served over any protocol, but you might want to start with parse-graphql-express.

Example usage:

import generateSchema from '@parse-graphql/schema';
import { graphql } from 'graphql';

const schema = generateSchema({
  appId: "foo",
  masterKey: "bar",
  serverURL: "https://foobar.com/parse"
});

const query = `
  query {
    someClass {
      name
    }
  }
`;

graphql(schema, query).then(result => {
  console.log(result);
});

To make authenticated requests, pass in a context with property sessionToken set to the sesion token of the current user:

graphql(schema, query, null, { sessionToken })
  .then(result => {
    // ...
  });

Readme

Keywords

none

Package Sidebar

Install

npm i @parse-graphql/schema

Weekly Downloads

3

Version

0.4.1

License

MIT

Unpacked Size

55.5 kB

Total Files

51

Last publish

Collaborators

  • stephentuso