Skip to content

GraphQL Support #5674

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

Merged
merged 146 commits into from
Jun 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
99881ed
GraphQL boilerplate
davimacedo Apr 18, 2019
57ec86e
Create GraphQL schema without using gql
davimacedo Apr 19, 2019
5a60a9c
Introducing loaders
davimacedo Apr 24, 2019
5e85d27
Generic create mutation
davimacedo Apr 26, 2019
b0fa772
Merging master
davimacedo Apr 27, 2019
8590361
Merge branch 'GraphQL' of github.com:back4app/parse-server into GraphQL
davimacedo Apr 27, 2019
0bb30d5
Merge branch 'upstream' into GraphQL
davimacedo Apr 30, 2019
a448989
Merge branch 'upstream' into GraphQL
davimacedo Apr 30, 2019
5aa0582
create mutation is now working for any data type
davimacedo May 1, 2019
96ade17
Create mutation for each parse class - partial
davimacedo May 1, 2019
57da696
Adding more data types to the class
davimacedo May 3, 2019
b490b9d
Get parse class query
davimacedo May 3, 2019
3465195
Generic get query
davimacedo May 3, 2019
dc66dfb
Generic delete mutation
davimacedo May 3, 2019
28fe08d
Parse class delete mutation
davimacedo May 3, 2019
a30bccf
Parse class find mutation
davimacedo May 3, 2019
d86b469
Generic update mutation
davimacedo May 3, 2019
25b48f7
Parse class update mutation
davimacedo May 3, 2019
61cbbdb
Merging upstream
davimacedo May 9, 2019
0b8d12e
Fixing initialization problems
davimacedo May 9, 2019
2e02e59
Installing node-fetch again
davimacedo May 9, 2019
97fd63b
Basic implementation for Pointer
davimacedo May 9, 2019
8200340
Constructor tests
davimacedo May 10, 2019
b6d7d2c
API tests boilerplate
davimacedo May 10, 2019
ba3e80f
_getGraphQLOptions
davimacedo May 10, 2019
92c056a
Merging upstream
davimacedo May 10, 2019
f72764f
applyGraphQL tests
davimacedo May 10, 2019
b1f8257
GraphQL API initial tests
davimacedo May 10, 2019
ec404f2
applyPlayground tests
davimacedo May 11, 2019
7549910
createSubscriptions tests
davimacedo May 11, 2019
28a0223
ParseGrapjQLSchema tests file
davimacedo May 13, 2019
3592f72
Merge branch 'upstream' into GraphQL
davimacedo May 13, 2019
4e7ed0c
Merge branch 'upstream' into GraphQL
davimacedo May 14, 2019
c9b4cd3
ParseGraphQLSchema tests
davimacedo May 14, 2019
2b35e91
TypeValidationError
davimacedo May 14, 2019
561d23c
TypeValidationError
davimacedo May 14, 2019
780846f
parseStringValue test
davimacedo May 14, 2019
ef73994
parseIntValue tests
davimacedo May 15, 2019
463e0d4
parseBooleanValue tests
davimacedo May 15, 2019
4e07f32
parseDateValue tests
davimacedo May 15, 2019
7c86577
parseValue tests
davimacedo May 16, 2019
d601e29
parseListValues tests
davimacedo May 16, 2019
80acd0a
parseObjectFields tests
davimacedo May 16, 2019
c02b7cd
Default types tests
davimacedo May 16, 2019
d7652d2
Get tests
davimacedo May 16, 2019
0b9bf48
First permission test at generic Get operation
davimacedo May 19, 2019
595ee0a
Fixing prepare data
davimacedo May 20, 2019
4e1b5ef
ApolloClient does not work well with different queries runnning in pa…
davimacedo May 21, 2019
de02899
ApolloClient does not work well with different queries runnning in pa…
davimacedo May 21, 2019
eb734a0
User 3 tests
davimacedo May 21, 2019
e8220c6
User 3 tests
davimacedo May 21, 2019
03edc13
Get level permission tests
davimacedo May 21, 2019
eaee48b
Get User specific tests
davimacedo May 21, 2019
7a063c9
Get now support keys argument
davimacedo May 21, 2019
c87ea67
Get now supports include argument
davimacedo May 21, 2019
3fbde8f
Get now supports read preferences
davimacedo May 21, 2019
9c593ab
Adding tests for read preference enum type
davimacedo May 21, 2019
f596fce
Find basic test
davimacedo May 21, 2019
b9e3873
Find permissions test
davimacedo May 22, 2019
0705fa7
Find where argument test
davimacedo May 22, 2019
d450d39
Order, skip and limit tests
davimacedo May 22, 2019
15268ec
Error handler
davimacedo May 23, 2019
5faabb8
Find now supports count
davimacedo May 23, 2019
d91cf04
Test for FindResult type
davimacedo May 23, 2019
b1be3f7
Improving find count
davimacedo May 23, 2019
0f64201
Find max limit test
davimacedo May 23, 2019
edaf67c
Find now supports keys, include and includeAll
davimacedo May 23, 2019
0c56861
Find now supports read preferences
davimacedo May 23, 2019
7f11b80
Basic Create test
davimacedo May 23, 2019
b67d512
Generic create mutation tests
davimacedo May 23, 2019
c109d8d
Basic update test
davimacedo May 23, 2019
07d7cea
UpdateResult object type test
davimacedo May 23, 2019
56ac44d
Update level permissions tests
davimacedo May 23, 2019
f106cdf
Error handler for default mutations
davimacedo May 23, 2019
fae9768
Delete mutation basic test
davimacedo May 23, 2019
18c0a2e
Delete mutation level permission tests
davimacedo May 24, 2019
b93b4e1
Test for string
davimacedo May 24, 2019
1bc2a4a
String test
davimacedo May 24, 2019
cd21bd2
Date test
davimacedo May 24, 2019
51ba877
Pointer test
davimacedo May 24, 2019
5b2c768
Relation tests
davimacedo May 25, 2019
4c4ccff
Changing objects mutations location
davimacedo May 28, 2019
95241bc
Changing objects queries location
davimacedo May 28, 2019
c2dfca9
Create file mutation
davimacedo May 29, 2019
b483b31
Test for file fields
davimacedo May 29, 2019
797555a
Test for null values
davimacedo May 29, 2019
5e92346
Changing parse classes operations location
davimacedo May 29, 2019
e1c8ad0
Objects mutations refactoring
davimacedo May 29, 2019
dac2af9
Class specific create object mutation now working
davimacedo May 30, 2019
309565b
Update class specific mutation now working
davimacedo May 30, 2019
f1e6db8
Specific class delete mutation now working
davimacedo May 30, 2019
479924e
Get class specific mutation now working
davimacedo May 30, 2019
5ee0997
Find class specific query now working without where and sort
davimacedo May 30, 2019
8ff64bf
Find query for custom classes working with where partially
davimacedo Jun 3, 2019
8d39c80
Almost all data types working for specfic class find where
davimacedo Jun 5, 2019
7732b5c
Now only missing relation, geopoint, file and ACL
davimacedo Jun 6, 2019
223f217
Additional tests with Parse classes queries and mutations
douglasmuraoka Jun 6, 2019
05c190c
Now only missing relation, geopoint, file and ACL
davimacedo Jun 6, 2019
edb4e04
Files
davimacedo Jun 7, 2019
0a8c086
Merging and fixing tests
davimacedo Jun 7, 2019
6caa0af
Fiels are now working
davimacedo Jun 7, 2019
a05c1c0
Excluding missing order test temporarly
davimacedo Jun 7, 2019
c647f67
Refactoring dates
davimacedo Jun 8, 2019
7432ad7
Refactoring files
davimacedo Jun 8, 2019
db47184
Default types review
davimacedo Jun 8, 2019
6fae23f
Refeactoring object queries
davimacedo Jun 10, 2019
a45b1ff
Refactoring class scalar type
davimacedo Jun 10, 2019
0935fbe
Refactoring class types
davimacedo Jun 10, 2019
74fee8c
Geo queries are now working
davimacedo Jun 10, 2019
cb24442
Fixing centerSphere
davimacedo Jun 10, 2019
f5520c8
Allow sort on class specific queries
douglasmuraoka Jun 7, 2019
a8fc36e
Supporting bytes
davimacedo Jun 10, 2019
79ec45c
ACL constraint
davimacedo Jun 10, 2019
339ef31
Merge branch 'GraphQL' of github.com:back4app/parse-server into GraphQL
davimacedo Jun 10, 2019
5d8cd13
Temporarly removing xit tests
davimacedo Jun 10, 2019
40fbcc9
Merging upstream
davimacedo Jun 10, 2019
70c41e3
Fixing some tests because of schema cache
davimacedo Jun 10, 2019
51989cc
Removing session token from users
davimacedo Jun 10, 2019
de62857
Parse.User queries and mutations
douglasmuraoka Jun 10, 2019
bafe8a0
Remove test using fit
douglasmuraoka Jun 10, 2019
72f3076
Fixing include test that was failing because of schema cache
davimacedo Jun 10, 2019
b1ce260
Fixing count test for postgres. Postgres does not count with where={}…
davimacedo Jun 10, 2019
4d8ff7b
Fix null values test for postgres. It is evaluating null as undefined…
davimacedo Jun 10, 2019
0b611a7
Fixing schema change test that was failing because of schema cache
davimacedo Jun 10, 2019
76f190b
Merge branch 'GraphQL' of github.com:back4app/parse-server into GraphQL
davimacedo Jun 11, 2019
cdd315e
Add GraphQL File type parseLiteral tests
douglasmuraoka Jun 11, 2019
13e0987
Refeactoring users
davimacedo Jun 11, 2019
edbbdb8
Including sign up mutation
davimacedo Jun 11, 2019
ed6cd8a
Merge branch 'GraphQL' of github.com:back4app/parse-server into GraphQL
davimacedo Jun 11, 2019
549cde8
Fix failing test
davimacedo Jun 11, 2019
b06fc36
Improve default GraphQL types tests coverage
douglasmuraoka Jun 11, 2019
bcfa897
Including some tests for data types
davimacedo Jun 11, 2019
333f468
Merge branch 'GraphQL' of github.com:back4app/parse-server into GraphQL
davimacedo Jun 11, 2019
ee276c2
Including additional pointer test:
davimacedo Jun 11, 2019
e3bf480
Fixing some tests
davimacedo Jun 11, 2019
95be5fb
more data type tests
davimacedo Jun 11, 2019
699b811
Include Bytes and Polygon data types tests
douglasmuraoka Jun 11, 2019
063975b
Polygons test
davimacedo Jun 11, 2019
6410a9e
Merging other tests
davimacedo Jun 11, 2019
45c26b1
Merging remote
davimacedo Jun 11, 2019
eb5fd94
Fixing some postgres tests
davimacedo Jun 11, 2019
24fe50c
Merge branch 'upstream' into GraphQL
davimacedo Jun 12, 2019
cb163fd
Merging upstream:
davimacedo Jun 12, 2019
5ddc058
Merging upstream
davimacedo Jun 19, 2019
b2761f0
Merge branch 'upstream' into GraphQL
davimacedo Jun 19, 2019
8ea056f
Merge branch 'upstream' into GraphQL
davimacedo Jun 19, 2019
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
872 changes: 868 additions & 4 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,22 @@
],
"license": "BSD-3-Clause",
"dependencies": {
"@apollographql/graphql-playground-html": "1.6.6",
"@parse/fs-files-adapter": "1.0.1",
"@parse/push-adapter": "3.0.0",
"@parse/s3-files-adapter": "1.2.1",
"@parse/simple-mailgun-adapter": "1.1.0",
"apollo-server-express": "2.4.8",
"bcryptjs": "2.4.3",
"body-parser": "1.19.0",
"commander": "2.20.0",
"cors": "2.8.5",
"deepcopy": "2.0.0",
"express": "4.17.1",
"follow-redirects": "1.7.0",
"graphql": "14.2.1",
"graphql-list-fields": "2.0.2",
"graphql-upload": "8.0.5",
"intersect": "1.0.1",
"jsonwebtoken": "8.5.1",
"lodash": "4.17.11",
Expand All @@ -40,6 +46,7 @@
"pg-promise": "8.7.2",
"redis": "2.8.0",
"semver": "6.1.1",
"subscriptions-transport-ws": "0.9.16",
"tv4": "1.3.0",
"uuid": "3.3.2",
"winston": "3.2.1",
Expand All @@ -53,13 +60,21 @@
"@babel/plugin-transform-flow-strip-types": "7.4.4",
"@babel/preset-env": "7.4.5",
"@parse/minami": "1.0.0",
"apollo-cache-inmemory": "1.5.1",
"apollo-client": "2.5.1",
"apollo-link": "1.2.11",
"apollo-link-http": "1.5.14",
"apollo-link-ws": "1.0.17",
"apollo-upload-client": "10.0.0",
"apollo-utilities": "1.2.1",
"babel-eslint": "10.0.2",
"bcrypt-nodejs": "0.0.3",
"cross-env": "5.2.0",
"deep-diff": "1.0.2",
"eslint": "5.16.0",
"eslint-plugin-flowtype": "3.10.3",
"flow-bin": "0.101.0",
"form-data": "2.3.3",
"gaze": "1.1.3",
"husky": "2.4.1",
"jasmine": "3.4.0",
Expand All @@ -68,6 +83,7 @@
"jsdoc-babel": "0.5.0",
"lint-staged": "8.2.1",
"mongodb-runner": "4.3.2",
"node-fetch": "2.5.0",
"nyc": "14.1.1",
"prettier": "1.18.2",
"supports-color": "7.0.0"
Expand Down
3 changes: 2 additions & 1 deletion spec/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"range": true,
"jequal": true,
"create": true,
"arrayContains": true
"arrayContains": true,
"expectAsync": true
},
"rules": {
"no-console": [0],
Expand Down
65 changes: 65 additions & 0 deletions spec/ParseGraphQLSchema.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
const defaultLogger = require('../lib/logger').default;
const { ParseGraphQLSchema } = require('../lib/GraphQL/ParseGraphQLSchema');

describe('ParseGraphQLSchema', () => {
let parseServer;
let databaseController;
let parseGraphQLSchema;

beforeAll(async () => {
parseServer = await global.reconfigureServer({
schemaCacheTTL: 100,
});
databaseController = parseServer.config.databaseController;
parseGraphQLSchema = new ParseGraphQLSchema(
databaseController,
defaultLogger
);
});

describe('constructor', () => {
it('should require a databaseController and a log instance', () => {
expect(() => new ParseGraphQLSchema()).toThrow(
'You must provide a databaseController instance!'
);
expect(() => new ParseGraphQLSchema({})).toThrow(
'You must provide a log instance!'
);
expect(() => new ParseGraphQLSchema({}, {})).not.toThrow();
});
});

describe('load', () => {
it('should cache schema', async () => {
const graphQLSchema = await parseGraphQLSchema.load();
expect(graphQLSchema).toBe(await parseGraphQLSchema.load());
await new Promise(resolve => setTimeout(resolve, 200));
expect(graphQLSchema).toBe(await parseGraphQLSchema.load());
});

it('should load a brand new GraphQL Schema if Parse Schema changes', async () => {
await parseGraphQLSchema.load();
const parseClasses = parseGraphQLSchema.parseClasses;
const parseClassesString = parseGraphQLSchema.parseClasses;
const parseClassTypes = parseGraphQLSchema.parseClasses;
const graphQLSchema = parseGraphQLSchema.parseClasses;
const graphQLTypes = parseGraphQLSchema.parseClasses;
const graphQLQueries = parseGraphQLSchema.parseClasses;
const graphQLMutations = parseGraphQLSchema.parseClasses;
const graphQLSubscriptions = parseGraphQLSchema.parseClasses;
const newClassObject = new Parse.Object('NewClass');
await newClassObject.save();
await databaseController.schemaCache.clear();
await new Promise(resolve => setTimeout(resolve, 200));
await parseGraphQLSchema.load();
expect(parseClasses).not.toBe(parseGraphQLSchema.parseClasses);
expect(parseClassesString).not.toBe(parseGraphQLSchema.parseClasses);
expect(parseClassTypes).not.toBe(parseGraphQLSchema.parseClasses);
expect(graphQLSchema).not.toBe(parseGraphQLSchema.parseClasses);
expect(graphQLTypes).not.toBe(parseGraphQLSchema.parseClasses);
expect(graphQLQueries).not.toBe(parseGraphQLSchema.parseClasses);
expect(graphQLMutations).not.toBe(parseGraphQLSchema.parseClasses);
expect(graphQLSubscriptions).not.toBe(parseGraphQLSchema.parseClasses);
});
});
});
Loading