Graphql tools v5 (#6611)

* 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>
This commit is contained in:
Yaacov Rydzinski
2020-04-21 01:16:48 -04:00
committed by GitHub
parent 84b2d072a6
commit a6300a2201
4 changed files with 232 additions and 186 deletions

View File

@@ -8,7 +8,7 @@ import { ParseGraphQLClassConfig } from '../../Controllers/ParseGraphQLControlle
import { transformClassNameToGraphQL } from '../transformers/className';
import { extractKeysAndInclude } from '../parseGraphQLUtils';
const getParseClassQueryConfig = function(
const getParseClassQueryConfig = function (
parseClassConfig: ?ParseGraphQLClassConfig
) {
return (parseClassConfig && parseClassConfig.query) || {};
@@ -50,7 +50,7 @@ const getQuery = async (
);
};
const load = function(
const load = function (
parseGraphQLSchema,
parseClass,
parseClassConfig: ?ParseGraphQLClassConfig
@@ -136,14 +136,15 @@ const load = function(
const { keys, include } = extractKeysAndInclude(
selectedFields
.filter(field => field.startsWith('edges.node.'))
.map(field => field.replace('edges.node.', ''))
.filter((field) => field.startsWith('edges.node.'))
.map((field) => field.replace('edges.node.', ''))
);
const parseOrder = order && order.join(',');
return await objectsQueries.findObjects(
className,
where,
order,
parseOrder,
skip,
first,
after,