Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(GraphQL): Unable to run queries with order as array #6310

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
8b8eed2
Update graphql to the latest version 🚀 (#6048)
greenkeeper[bot] Sep 13, 2019
1c8e814
Update eslint to the latest version 🚀 (#6050)
greenkeeper[bot] Sep 14, 2019
fc57ff4
Update graphql to the latest version 🚀 (#6054)
greenkeeper[bot] Sep 15, 2019
d704740
Update GraphQL readme section (#6056)
davimacedo Sep 17, 2019
7225c8e
Update cross-env to the latest version 🚀 (#6058)
greenkeeper[bot] Sep 17, 2019
da4871a
Update flow-bin to the latest version 🚀 (#6063)
greenkeeper[bot] Sep 19, 2019
431cb94
Use #!/bin/bash instead of #!/bin/sh (#6062)
brodo Sep 19, 2019
065caab
Update node-rsa to the latest version 🚀 (#6064)
greenkeeper[bot] Sep 19, 2019
24bed70
Install parse-server 3.9.0 insted of 2.2 (#6069)
brodo Sep 20, 2019
4a9a275
Update graphql to the latest version 🚀 (#6070)
greenkeeper[bot] Sep 20, 2019
f56ac26
Update jasmine to the latest version 🚀 (#6071)
greenkeeper[bot] Sep 21, 2019
ffd7389
Update lint-staged to the latest version 🚀 (#6074)
greenkeeper[bot] Sep 22, 2019
5b3deb8
Update babel7 to the latest version 🚀 (#6078)
greenkeeper[bot] Sep 23, 2019
eec739a
Update graphql to the latest version 🚀 (#6084)
greenkeeper[bot] Sep 25, 2019
ebd1752
Update commander to the latest version 🚀 (#6085)
greenkeeper[bot] Sep 26, 2019
48e03c8
Bump apollo-server-express from 2.9.3 to 2.9.4 (#6083)
dependabot-preview[bot] Sep 26, 2019
dd08786
Bump lint-staged from 9.3.0 to 9.4.0 (#6086)
dependabot-preview[bot] Sep 26, 2019
38e0ff9
Microsoft Graph Authentication (#6051)
alann-maulana Sep 26, 2019
fe90582
Update pg-promise to the latest version 🚀 (#6076)
greenkeeper[bot] Sep 27, 2019
75a27ca
Bump pg-promise from 9.1.4 to 9.2.1 (#6077)
dependabot-preview[bot] Sep 27, 2019
46550fe
Update husky to the latest version 🚀 (#6090)
greenkeeper[bot] Sep 28, 2019
6aaebb6
Update eslint to the latest version 🚀 (#6092)
greenkeeper[bot] Sep 29, 2019
dbd5f73
Bump husky from 3.0.6 to 3.0.7 (#6093)
dependabot-preview[bot] Sep 30, 2019
8f53034
Update lint-staged to the latest version 🚀 (#6096)
greenkeeper[bot] Oct 1, 2019
c63864f
Bump eslint from 6.5.0 to 6.5.1 (#6097)
dependabot-preview[bot] Oct 1, 2019
6a45213
Update cross-env to the latest version 🚀 (#6098)
greenkeeper[bot] Oct 1, 2019
4998135
Update the pgp public key block (#6099)
acinader Oct 2, 2019
9cf3b52
Update husky to the latest version 🚀 (#6100)
greenkeeper[bot] Oct 2, 2019
2290145
GraphQL: ACL (#5957)
Moumouls Oct 2, 2019
27616c9
Bump cross-env from 6.0.2 to 6.0.3 (#6105)
dependabot-preview[bot] Oct 3, 2019
65cedd5
Bump pg-promise from 9.2.1 to 9.3.3 (#6111)
dependabot-preview[bot] Oct 7, 2019
a0e16fb
Update lint-staged to the latest version 🚀 (#6112)
greenkeeper[bot] Oct 8, 2019
ee6993a
Bump apollo-server-express from 2.9.4 to 2.9.5 (#6110)
dependabot-preview[bot] Oct 8, 2019
068bcc5
Bump flow-bin from 0.108.0 to 0.109.0 (#6104)
dependabot-preview[bot] Oct 8, 2019
274f193
Bump @babel/preset-env from 7.6.2 to 7.6.3 (#6116)
dependabot-preview[bot] Oct 9, 2019
fe15d8f
Bump @babel/cli from 7.6.2 to 7.6.3 (#6117)
dependabot-preview[bot] Oct 9, 2019
eb1fb82
Bump @babel/plugin-transform-flow-strip-types from 7.4.4 to 7.6.3 (#6…
dependabot-preview[bot] Oct 9, 2019
f7b498e
Bump @babel/core from 7.6.2 to 7.6.3 (#6115)
dependabot-preview[bot] Oct 9, 2019
6af7b6a
adds code formatting to contributing guidelines (#6119)
andresgalante Oct 9, 2019
8aa0687
Adds a line on the read me to make installation instructions easier (…
andresgalante Oct 9, 2019
aef972b
Update graphql-upload to the latest version 🚀 (#6121)
greenkeeper[bot] Oct 10, 2019
42cf208
Bump apollo-server-express from 2.9.5 to 2.9.6 (#6123)
dependabot-preview[bot] Oct 10, 2019
84b79ba
Update mongodb-runner to the latest version 🚀 (#6125)
greenkeeper[bot] Oct 10, 2019
f26008f
Update babel7 to the latest version 🚀 (#6124)
greenkeeper[bot] Oct 10, 2019
edfa1df
Cleanup Schema cache per request (#6126)
dplewis Oct 11, 2019
44c77fa
Update husky to the latest version 🚀 (#6129)
greenkeeper[bot] Oct 13, 2019
b709150
fix(GraphQL): Mutations not returning updated information (#6130)
omairvaiyani Oct 14, 2019
45bf4e6
Update @parse/push-adapter to the latest version 🚀 (#6131)
greenkeeper[bot] Oct 14, 2019
095164b
Prevent afterFind with saving objects (#6127)
dplewis Oct 15, 2019
c9902ac
Test with node 12 to get the ball rolling... (#6133)
acinader Oct 16, 2019
46c01c7
Bump parse from 2.7.1 to 2.8.0 (#6134)
dependabot-preview[bot] Oct 16, 2019
d7bcc72
Update stale.yml (#6142)
dplewis Oct 18, 2019
c1a217c
Support Apple Game Center Auth (#6143)
dplewis Oct 19, 2019
05d2aa3
Update ws to the latest version 🚀 (#6146)
greenkeeper[bot] Oct 19, 2019
a6b01c7
Update flow-bin to the latest version 🚀 (#6150)
greenkeeper[bot] Oct 22, 2019
ac4d9ed
Bump apollo-server-express from 2.9.6 to 2.9.7 (#6151)
dependabot-preview[bot] Oct 22, 2019
f67f8db
Update flow-bin to the latest version 🚀 (#6155)
greenkeeper[bot] Oct 24, 2019
f50f8be
Bump graphql-tools from 4.0.5 to 4.0.6 (#6158)
dependabot-preview[bot] Oct 25, 2019
cf9245a
Added warning for special URL sensitive characters for appId (#6159)
ssafayet Oct 26, 2019
93fe6b4
Update eslint to the latest version 🚀 (#6160)
greenkeeper[bot] Oct 26, 2019
1c8d4a6
Move filename validation out of the Router and into the FilesAdaptor …
Oct 27, 2019
9d781c4
Throw error when setting authData to null (#6154)
mtrezza Oct 28, 2019
355663c
Update @parse/push-adapter to the latest version 🚀 (#6162)
greenkeeper[bot] Oct 28, 2019
b447269
Support Google Play Games Service (#6147)
dplewis Oct 28, 2019
16af2e4
Add exposing port in docker container (#6165)
priyashpatil Oct 28, 2019
87d143e
Update flow-bin to the latest version 🚀 (#6168)
greenkeeper[bot] Oct 31, 2019
d2d7ea7
Update commander to the latest version 🚀 (#6170)
greenkeeper[bot] Nov 1, 2019
4a5fed8
Update flow-bin to the latest version 🚀 (#6172)
greenkeeper[bot] Nov 1, 2019
2533db0
Fix installationId on LiveQuery connect (#6180)
dplewis Nov 4, 2019
c4856ee
Bump @babel/core from 7.6.4 to 7.7.0 (#6181)
dependabot-preview[bot] Nov 5, 2019
3309ce2
Bump @babel/preset-env from 7.6.3 to 7.7.0 (#6183)
dependabot-preview[bot] Nov 5, 2019
1e788a7
Update babel7 to the latest version 🚀 (#6184)
greenkeeper[bot] Nov 5, 2019
4e79817
Update mongodb-runner to the latest version 🚀 (#6187)
greenkeeper[bot] Nov 5, 2019
b205d2b
Update flow-bin to the latest version 🚀 (#6188)
greenkeeper[bot] Nov 6, 2019
227741b
Update form-data to the latest version 🚀 (#6189)
greenkeeper[bot] Nov 6, 2019
6009ffe
Bump @babel/preset-env from 7.7.0 to 7.7.1 (#6190)
dependabot-preview[bot] Nov 6, 2019
7eb9284
Bump mongodb-runner from 4.7.4 to 4.7.5 (#6191)
dependabot-preview[bot] Nov 6, 2019
453accf
Add funding link (#6192)
TomWFox Nov 6, 2019
390cfa5
Update babel7 to the latest version 🚀 (#6194)
greenkeeper[bot] Nov 7, 2019
5d6ce45
Update parse to the latest version 🚀 (#6197)
greenkeeper[bot] Nov 7, 2019
150d785
Bump mongodb from 3.3.2 to 3.3.3
dependabot-preview[bot] Nov 7, 2019
78f76cb
Update pg-promise to the latest version 🚀 (#6196)
greenkeeper[bot] Nov 7, 2019
a2d332f
Fix #6179 Initializing default logger (#6186)
dplewis Nov 7, 2019
fca68be
Update pg-promise to the latest version 🚀 (#6200)
greenkeeper[bot] Nov 9, 2019
042ff41
Update pg-promise to the latest version 🚀 (#6201)
greenkeeper[bot] Nov 10, 2019
8c53607
Update pg-promise to the latest version 🚀 (#6203)
greenkeeper[bot] Nov 10, 2019
b6bddee
Update prettier to the latest version 🚀 (#6199)
greenkeeper[bot] Nov 11, 2019
41a6f22
Update pg-promise to the latest version 🚀 (#6206)
greenkeeper[bot] Nov 11, 2019
ede381e
Update commander to the latest version 🚀 (#6204)
greenkeeper[bot] Nov 12, 2019
8b83b31
Update apollo-server to the latest version 🚀 (#6210)
greenkeeper[bot] Nov 12, 2019
fb7fa6d
Update flow-bin to the latest version 🚀 (#6211)
greenkeeper[bot] Nov 12, 2019
8ede370
Update pg-promise to the latest version 🚀 (#6208)
greenkeeper[bot] Nov 12, 2019
e31f19e
Update lint-staged to the latest version 🚀 (#6212)
greenkeeper[bot] Nov 13, 2019
fccf9ca
Update apollo-server to the latest version 🚀 (#6213)
greenkeeper[bot] Nov 13, 2019
5cfaaf0
Update parse to the latest version 🚀 (#6215)
greenkeeper[bot] Nov 15, 2019
5ed0885
added afterLogout trigger (#6217)
mtrezza Nov 16, 2019
6a2550d
Update bcrypt to the latest version 🚀 (#6222)
greenkeeper[bot] Nov 21, 2019
1ab2bcb
Update husky to the latest version 🚀 (#6221)
greenkeeper[bot] Nov 21, 2019
04639a6
Update apollo-server to the latest version 🚀 (#6229)
greenkeeper[bot] Nov 21, 2019
e8b584b
Update apollo-server to the latest version 🚀 (#6233)
greenkeeper[bot] Nov 21, 2019
1a82a35
Update eslint-plugin-flowtype to the latest version 🚀 (#6209)
greenkeeper[bot] Nov 21, 2019
dff6825
Update eslint to the latest version 🚀 (#6234)
greenkeeper[bot] Nov 22, 2019
5bf87d8
Improve WebSocketServer Error Handling (#6230)
dplewis Nov 22, 2019
7c7a870
Update babel7 to the latest version 🚀 (#6236)
greenkeeper[bot] Nov 23, 2019
2f05d81
beforeFind: Improve request.query object (#6237)
dplewis Nov 23, 2019
552511a
Update pg-promise to the latest version 🚀 (#6238)
greenkeeper[bot] Nov 24, 2019
9c72e4c
Update eslint to the latest version 🚀 (#6240)
greenkeeper[bot] Nov 25, 2019
cf26434
Update node-rsa to the latest version 🚀 (#6241)
greenkeeper[bot] Nov 25, 2019
4435154
Add LDAP auth module (#6226)
brodo Nov 25, 2019
6245996
Change ACL to Non null (#6249)
Moumouls Dec 2, 2019
c7ea30c
Update lint-staged to the latest version 🚀 (#6243)
greenkeeper[bot] Dec 2, 2019
67e3c33
Update eslint-plugin-flowtype to the latest version 🚀 (#6239)
greenkeeper[bot] Dec 2, 2019
a9066e2
Relay Spec (#6089)
davimacedo Dec 2, 2019
ca277be
Update eslint to the latest version 🚀 (#6247)
greenkeeper[bot] Dec 2, 2019
b75a73c
Update apollo-upload-client to the latest version 🚀 (#6250)
greenkeeper[bot] Dec 2, 2019
a7cb381
Allow validateFilename to return a string or Parse Error (#6246)
Dec 3, 2019
281997b
Update apollo-upload-client to the latest version 🚀 (#6252)
greenkeeper[bot] Dec 3, 2019
1f54d02
Update flow-bin to the latest version 🚀 (#6251)
greenkeeper[bot] Dec 3, 2019
abcc5fd
Update graphql-upload to the latest version 🚀 (#6254)
greenkeeper[bot] Dec 3, 2019
188f033
GraphQL classConfig query alias (#6257)
BufferUnderflower Dec 4, 2019
9859339
Suppress Test Logs (#6256)
dplewis Dec 4, 2019
917c671
Update parse to the latest version 🚀 (#6253)
greenkeeper[bot] Dec 4, 2019
6db040b
GraphQL alias for mutations in classConfigs (#6258)
BufferUnderflower Dec 4, 2019
afe49cb
Run tests against Postgres 11 (#6260)
dplewis Dec 4, 2019
5d76b2f
GraphQL: DX Relational Where Query (#6255)
Moumouls Dec 5, 2019
d49c79e
Update apollo-server to the latest version 🚀 (#6264)
greenkeeper[bot] Dec 5, 2019
aa5e3f5
Update babel7 to the latest version 🚀 (#6266)
greenkeeper[bot] Dec 6, 2019
3de12fa
Update MongoDB to 3.3.5 (#6263)
dplewis Dec 7, 2019
0ad7e7a
Update babel7 to the latest version 🚀 (#6269)
greenkeeper[bot] Dec 8, 2019
14b7b20
Update mongodb to the latest version 🚀 (#6272)
greenkeeper[bot] Dec 10, 2019
4f1d3b0
Update @parse/s3-files-adapter to the latest version 🚀 (#6274)
greenkeeper[bot] Dec 11, 2019
e0e06ef
Handle required fields (#6271)
Moumouls Dec 12, 2019
21de2bd
Update semver to the latest version 🚀 (#6283)
greenkeeper[bot] Dec 15, 2019
87e56cb
Update ws to the latest version 🚀 (#6281)
greenkeeper[bot] Dec 15, 2019
e29e228
Update apollo-client to the latest version 🚀 (#6282)
greenkeeper[bot] Dec 15, 2019
2fc328e
Update flow-bin to the latest version 🚀 (#6280)
greenkeeper[bot] Dec 15, 2019
a72ab50
GraphQL: Support required fields on output type (#6279)
Moumouls Dec 15, 2019
2d665c9
Update PostgresStorageAdapter.js (#6275)
vitaly-t Dec 16, 2019
d9f36b0
Add missing encodeURIComponent on username password reset (#6278)
Klaitos Dec 17, 2019
7944ef1
Update semver to the latest version 🚀 (#6284)
greenkeeper[bot] Dec 17, 2019
8bc201d
#6101 Let users define objectId (#6177)
rhuanbarreto Dec 17, 2019
1833909
Update apollo-server to the latest version 🚀 (#6285)
greenkeeper[bot] Dec 17, 2019
71e7894
Update semver to the latest version 🚀 (#6286)
greenkeeper[bot] Dec 18, 2019
a616fa0
Update mongodb to the latest version 🚀 (#6290)
greenkeeper[bot] Dec 20, 2019
81ca1fc
Update eslint to the latest version 🚀 (#6291)
greenkeeper[bot] Dec 21, 2019
b0fcb93
Update babel7 to the latest version 🚀 (#6289)
greenkeeper[bot] Dec 21, 2019
49a0405
Update nyc to the latest version 🚀 (#6294)
greenkeeper[bot] Dec 23, 2019
1a99cb3
Add maxLogFiles option (#6296)
dplewis Dec 24, 2019
ef4248c
Update parse to the latest version 🚀 (#6297)
greenkeeper[bot] Dec 26, 2019
47454ef
Update pg-promise to the latest version 🚀 (#6298)
greenkeeper[bot] Dec 27, 2019
832a081
Add syntax highlighting for bash codes (#6302)
JeromeDeLeon Dec 27, 2019
558ce66
Update apollo-server to the latest version 🚀 (#6303)
greenkeeper[bot] Dec 27, 2019
d7236ba
fix(GraphQL): Timeout when fetching huge collections (#6304)
douglasmuraoka Dec 28, 2019
851c57f
fix(GraphQL): Unable to run queries with order as array
douglasmuraoka Dec 31, 2019
55c51c3
Update flow-bin to the latest version 🚀 (#6313)
greenkeeper[bot] Jan 4, 2020
576631f
Reset and Send verification email (#6301)
Moumouls Jan 4, 2020
382f7ca
Merge branch 'upstream' into fix_gql_order_as_array
davimacedo Jan 6, 2020
ef6706a
Add tests
davimacedo Jan 6, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ daysUntilStale: 45
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
- good first issue
- up-for-grabs
- bug
- enhancement
- feature request
- good first issue
- hacktoberfest
- help wanted
- needs investigation
- needs more info
- question
- pinned
- security
- up-for-grabs
# Label to use when marking an issue as stale
staleLabel: wontfix
# Limit to only `issues` not `pulls`
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ lib/

# Folder created by FileSystemAdapter
/files

# Redis Dump
dump.rdb
18 changes: 13 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
language: node_js
dist: trusty
dist: xenial
services:
- postgresql
- redis-server
- docker
addons:
postgresql: '9.5'
postgresql: '11'
apt:
packages:
- postgresql-9.5-postgis-2.3
- postgresql-11
- postgresql-11-postgis-2.5
- postgresql-11-postgis-2.5-scripts
branches:
only:
- master
Expand All @@ -18,23 +20,29 @@ branches:
cache:
directories:
- "$HOME/.npm"
- ".eslintcache"
stage: test
env:
global:
- COVERAGE_OPTION='./node_modules/.bin/nyc'
- PGPORT=5432
matrix:
- MONGODB_VERSION=4.0.4 MONGODB_TOPOLOGY=replicaset MONGODB_STORAGE_ENGINE=wiredTiger
- MONGODB_VERSION=3.6.9
- PARSE_SERVER_TEST_DB=postgres
- PARSE_SERVER_TEST_CACHE=redis
- NODE_VERSION=11.4.0
- NODE_VERSION=12.12.0
matrix:
allow_failures:
- env: NODE_VERSION=11.4.0
- env: NODE_VERSION=12.12.0
before_install:
- nvm install $NODE_VERSION
- nvm use $NODE_VERSION
- npm install -g greenkeeper-lockfile@1
- sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/11/main/postgresql.conf
- sudo cp /etc/postgresql/{10,11}/main/pg_hba.conf
- sudo service postgresql stop
- sudo service postgresql start 11
before_script:
- node -e 'require("./lib/index.js")'
- psql -c 'create database parse_server_postgres_adapter_test_database;' -U postgres
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Once you have babel running in watch mode, you can start making changes to parse

### Good to know:

* The lib/ folder is not commited, so never make changes in there.
* The `lib/` folder is not commited, so never make changes in there.
* Always make changes to files in the `src/` folder.
* All the tests should point to sources in the `lib/` folder.

Expand Down
151 changes: 117 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,14 @@ The fastest and easiest way to get started is to run MongoDB and Parse Server lo

## Running Parse Server

Before you start make sure you have installed:

- [NodeJS](https://www.npmjs.com/) that includes `npm`
- [MongoDB](https://www.mongodb.com/) or [PostgreSQL](https://www.postgresql.org/)
- Optionally [Docker](https://www.docker.com/)

### Locally
```
```bash
$ npm install -g parse-server mongodb-runner
$ mongodb-runner start
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test
Expand All @@ -88,12 +94,12 @@ $ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongo


### Inside a Docker container
```
```bash
$ git clone https://github.com/parse-community/parse-server
$ cd parse-server
$ docker build --tag parse-server .
$ docker run --name my-mongo -d mongo
$ docker run --name my-parse-server --link my-mongo:mongo -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test
$ docker run --name my-parse-server -p 1337:1337 --link my-mongo:mongo -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test
```

You can use any arbitrary string as your application id and master key. These will be used by your clients to authenticate with the Parse Server.
Expand All @@ -107,7 +113,7 @@ That's it! You are now running a standalone version of Parse Server on your mach
Now that you're running Parse Server, it is time to save your first object. We'll use the [REST API](http://docs.parseplatform.org/rest/guide), but you can easily do the same using any of the [Parse SDKs](http://parseplatform.org/#sdks). Run the following:

```bash
curl -X POST \
$ curl -X POST \
-H "X-Parse-Application-Id: APPLICATION_ID" \
-H "Content-Type: application/json" \
-d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
Expand Down Expand Up @@ -144,7 +150,7 @@ $ curl -X GET \

Keeping tracks of individual object ids is not ideal, however. In most cases you will want to run a query over the collection, like so:

```
```bash
$ curl -X GET \
-H "X-Parse-Application-Id: APPLICATION_ID" \
http://localhost:1337/parse/classes/GameScore
Expand Down Expand Up @@ -418,10 +424,10 @@ Take a look at [Live Query Guide](https://docs.parseplatform.org/parse-server/gu

The easiest way to run the Parse GraphQL API is through the CLI:

```
```bash
$ npm install -g parse-server mongodb-runner
$ mongodb-runner start
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test --mountGraphQL --mountPlayground
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test --publicServerURL http://localhost:1337/parse --mountGraphQL --mountPlayground
```

After starting the server, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.
Expand All @@ -432,12 +438,12 @@ After starting the server, you can visit http://localhost:1337/playground in you

You can also run the Parse GraphQL API inside a Docker container:

```
```bash
$ git clone https://github.com/parse-community/parse-server
$ cd parse-server
$ docker build --tag parse-server .
$ docker run --name my-mongo -d mongo
$ docker run --name my-parse-server --link my-mongo:mongo -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test --mountGraphQL --mountPlayground
$ docker run --name my-parse-server --link my-mongo:mongo -p 1337:1337 -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test --publicServerURL http://localhost:1337/parse --mountGraphQL --mountPlayground
```

After starting the server, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.
Expand All @@ -446,9 +452,17 @@ After starting the server, you can visit http://localhost:1337/playground in you

### Using Express.js

You can also mount the GraphQL API in an Express.js application together with the REST API or solo:
You can also mount the GraphQL API in an Express.js application together with the REST API or solo. You first need to create a new project and install the required dependencies:

```bash
$ mkdir my-app
$ cd my-app
$ npm install parse-server express --save
```

Then, create an `index.js` file with the following content:

```js
const express = require('express');
const { default: ParseServer, ParseGraphQLServer } = require('parse-server');

Expand All @@ -458,7 +472,8 @@ const parseServer = new ParseServer({
databaseURI: 'mongodb://localhost:27017/test',
appId: 'APPLICATION_ID',
masterKey: 'MASTER_KEY',
serverURL: 'http://localhost:1337/parse'
serverURL: 'http://localhost:1337/parse',
publicServerURL: 'http://localhost:1337/parse'
});

const parseGraphQLServer = new ParseGraphQLServer(
Expand All @@ -480,7 +495,14 @@ app.listen(1337, function() {
});
```

After starting the server, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.
And finally start your app:

```bash
$ npx mongodb-runner start
$ node index.js
```

After starting the app, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.

***Note:*** Do ***NOT*** mount the GraphQL Playground in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps.

Expand All @@ -504,43 +526,93 @@ You should receive the following response:
}
```

## Creating your first object
## Creating your first class

Since your application does not have a schema yet, you can use the generic `create` mutation to create your first object. Run the following:
Since your application does not have any schema yet, you can use the `createClass` mutation to create your first class. Run the following:

```graphql
mutation CreateObject {
create(className: "GameScore" fields: { score: 1337 playerName: "Sean Plott" cheatMode: false }) {
objectId
createdAt
mutation CreateClass {
createClass(
name: "GameScore"
schemaFields: {
addStrings: [{ name: "playerName" }]
addNumbers: [{ name: "score" }]
addBooleans: [{ name: "cheatMode" }]
}
) {
name
schemaFields {
name
__typename
}
}
}
```

You should receive a response similar to this:
You should receive the following response:

```json
{
"data": {
"create": {
"objectId": "CVuh0o0ioY",
"createdAt": "2019-08-27T06:35:15.641Z"
"createClass": {
"name": "GameScore",
"schemaFields": [
{
"name": "objectId",
"__typename": "SchemaStringField"
},
{
"name": "updatedAt",
"__typename": "SchemaDateField"
},
{
"name": "createdAt",
"__typename": "SchemaDateField"
},
{
"name": "playerName",
"__typename": "SchemaStringField"
},
{
"name": "score",
"__typename": "SchemaNumberField"
},
{
"name": "cheatMode",
"__typename": "SchemaBooleanField"
},
{
"name": "ACL",
"__typename": "SchemaACLField"
}
]
}
}
}
```

## Using automatically generated operations

Parse Server learned from the first object that you created and now you have the `GameScore` class in your schema. You can now start using the automatically generated operations!
Parse Server learned from the first class that you created and now you have the `GameScore` class in your schema. You can now start using the automatically generated operations!

Run the following to create a second object:
Run the following to create your first object:

```graphql
mutation CreateGameScore {
createGameScore(fields: { score: 2558 playerName: "Luke Skywalker" cheatMode: false }) {
objectId
createGameScore(
fields: {
playerName: "Sean Plott"
score: 1337
cheatMode: false
}
) {
id
updatedAt
createdAt
playerName
score
cheatMode
ACL
}
}
```
Expand All @@ -551,8 +623,13 @@ You should receive a response similar to this:
{
"data": {
"createGameScore": {
"objectId": "XyvErLoJ2O",
"createdAt": "2019-08-27T06:37:32.078Z"
"id": "XN75D94OBD",
"updatedAt": "2019-09-17T06:50:26.357Z",
"createdAt": "2019-09-17T06:50:26.357Z",
"playerName": "Sean Plott",
"score": 1337,
"cheatMode": false,
"ACL": null
}
}
}
Expand All @@ -564,8 +641,13 @@ You can also run a query to this new class:
query GameScores {
gameScores {
results {
id
updatedAt
createdAt
playerName
score
cheatMode
ACL
}
}
}
Expand All @@ -579,12 +661,13 @@ You should receive a response similar to this:
"gameScores": {
"results": [
{
"id": "XN75D94OBD",
"updatedAt": "2019-09-17T06:50:26.357Z",
"createdAt": "2019-09-17T06:50:26.357Z",
"playerName": "Sean Plott",
"score": 1337
},
{
"playerName": "Luke Skywalker",
"score": 2558
"score": 1337,
"cheatMode": false,
"ACL": null
}
]
}
Expand All @@ -599,7 +682,7 @@ Parse GraphQL Server allows you to create a custom GraphQL schema with own queri
To start creating your custom schema, you need to code a `schema.graphql` file and initialize Parse Server with `--graphQLSchema` and `--cloud` options:

```bash
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test --mountGraphQL --mountPlayground --graphQLSchema ./schema.graphql --cloud ./main.js
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test --publicServerURL http://localhost:1337/parse --cloud ./cloud/main.js --graphQLSchema ./cloud/schema.graphql --mountGraphQL --mountPlayground
```

### Creating your first custom query
Expand Down
Loading