Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

parse-graphql/parse-graphql-schema

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is now supported out of the box by parse server

Parse GraphQL Schema Parse GraphQL Logo

npm (scoped) stability-experimental Greenkeeper badge CircleCI

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 => {
    // ...
  });