* Optimize query, fixes some null returns, fix stitched GraphQLUpload
* Fix authData key selection
* Prefer Iso string since other GraphQL solutions use this format
* fix tests
Co-authored-by: Antonio Davi Macedo Coelho de Castro <adavimacedo@gmail.com>
* Add test case for order option when extending the schema
* Remove fit
* upgrade to graphql-tools v5
revert #6515
Co-authored-by: Antonio Davi Macedo Coelho de Castro <adavimacedo@gmail.com>
* Allow real GraphQL Schema via ParseServer.start
* wip
* working
* tests ok
* add tests about enum/input use case
* Add async function based merge
* Better naming
* remove useless condition
* fix(GraphQL): Timeout when fetching huge collections
Currently, when not specifying a `limit` to the GraphQL find-like query, it tries to fetch the entire collection of objects from a class. However, if the class contains a huge set of objects, it is never resolved and results in timeout.
In order to solve this kind of problem, `parse-server` allows us to define a `maxLimit` parameter when initialized, which limits the maximum number of objects fetched per query; but it is not properly considered when the `limit` is undefined.
* fix: Keep same behavior as REST fetch
* Install graphql-relay
* Add relayNodeInterface to ParseGraphQLSchema
* Add support to global id
* Add support to global id in other operations
* Fix sort by glboal id
* Fix where by global id
* Introduce IdWhereInput
* Add Relay object identification tests
* Client mutation id on createFile mutation
* Client mutation id on callCloudCode mutation
* Client mutation id on signUp mutation
* Client mutation id on logIn mutation
* Client mutation id on logOut mutation
* Client mutation id on createClass mutation
* Client mutation id on updateClass mutation
* Client mutation id on deleteClass mutation
* Client mutation id on create object mutation
* Improve Viewer type
* Client mutation id on update object mutation
* Client mutation id on delete object mutation
* Introducing connections
* Fix tests
* Add pagination test
* Fix file location
* Fix postgres tests
* Add comments
* Tests to calculateSkipAndLimit
This issue was spotted when an updated field is modified in beforeSave, but the unmodified version is returned if requested by the resolver.
For example
```graphql
mutation UpdateTitle($id: ID!, $title: String!) {
updateSomeObject(id: $id, fields: { title: $title }) {
id
title
slug
}
}
```
In the above, if we modify the `title` by let's say, trimming it - the resolved `title` will not reflect this change, and instead just return the input variable. Other resolved fields that are not sent within the `fields` input are returned properly using the latest data.
* refactor(GraphQL): Pointer constraint input type as ID
Redefines the Pointer constraint input type from a custom scalar to
a simple ID.
* fix: PR review requested changes
* Remove nested operations
* Improve error log
* Fix bug schema to load
* Fix ParseGraphQLSchema tests
* Fix tests
* Fix failing tests
* First verstion not complete of create class mutation
* Fix bug caused by circular dependency
* Renaming files
* Schema types should be loaded before parse classes
* Fix tests
* Create class mutation boilerplate
* Improve CreateClassSchemaInput fields names
* Remove fields
* Pointer and relation fields
* Improve pointer default type
* Class type
* Create class mutation resolver
* Schema field transformers
* Class types transformations
* First test
* Numbers test
* Boolean tests
* Date test
* Fix some get tests
* Test for created at and updated at
* File tests
* Test for objects
* Renaming reducerFabric to reducerGenerator
* Changing get tests for file and object
* Object composed queries test
* Array test
* Null field test
* Bytes test
* Geo Point test
* Polygons tests
* Remove create generic mutation
* Fix tests
* Create class test - isRequired and defaultValue will be added back later
* Enforce master key
* Fix tests
* Duplicated field test
* updateClass mutation
* Remove update generic mutation tests
* Remove update generic mutation
* deleteClass mutation
* Remove delete generic mutation tests
* Remove delete generic mutation
* class query
* Classes query
* Remove get generic query from tests
* Remove remaining generic operations and fix tests
* Fix last test
* Try to fix redis tests
* Fix postgres tests
* Update objectsMutations and objectsQueries files locations
* Rename classSchema files to schema files
* Rename ClassObject to ParseObject
* Fix names and paths
* Still some wrong names
* refactor(GraphQL): Rename objectId to id
Renames `objectId` to `id` for the GraphQL API. Queries, mutations,
custom and generic types were updated.
Removes `RELATION_INPUT` and `POINTER_INPUT`. Now the user just need
to provide the ID of the object to link.
* fix: Column "id" not found on Postgres
* fix: Avoid deleting Parse class objectId
* fix: Undo objectId removal on mutations
* fix: Handle generic mutation id
* Add a test on deep complex GraphQL Query
* Relation/Pointer new DX + deep nested mutations
* Fix lint
* Review
* Remove unnecessary code
* Fix objectId on update
* Renaming GraphQL Types/Inputs
* Add Native Type to avoid collision
* Use pluralize for renaming
* Fixing tests
* Improve name collision management - tests passsing
* Renaming few more default types
* Rename file input
* Reverting fields types to not collide with the relay spec types
Improver users mutations
* Adding ArrayResult to the reserved list
* Fixing tests
* Add more unit tests to ParseGraphQLSchema
* Test transformClassNameToGraphQL
* Name collision tests
* GraphQL Object constraints
Implements the GraphQL Object constraints, which allows us to filter queries results using the `$eq`, `$lt`, `$gt`, `$in`, and other Parse supported constraints.
Example:
```
query objects {
findMyClass(where: {
objField: {
_eq: {
key: 'foo.bar',
value: 'hello'
},
_gt: {
key: 'foo.number',
value: 10
},
_lt: {
key: 'anotherNumber',
value: 5
}
}
}) {
results {
objectId
}
}
}
```
In the example above, we have the `findMyClass` query (automatically generated for the `MyClass` class), and a field named `objField` whose type is Object. The object below represents a valid `objField` value and would satisfy all constraints:
```
{
"foo": {
"bar": "hello",
"number": 11
},
"anotherNumber": 4
}
```
The Object constraint is applied only when using Parse class object type queries. When using "generic" queries such as `get` and `find`, this type of constraint is not available.
* Objects constraints not working on Postgres
Fixes the $eq, $ne, $gt, and $lt constraints when applied on an Object type field.
* Fix object constraint field name
* Fix Postgres constraints indexes
* fix: Object type composed constraints not working
* fix: Rename key and value fields
* refactor: Object constraints for generic queries
* fix: Object constraints not working on Postgres