refactor(GraphQL): Rename objectId to id (#5985)

* 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
This commit is contained in:
Douglas Muraoka
2019-08-30 20:23:46 -03:00
committed by Antonio Davi Macedo Coelho de Castro
parent 194f548464
commit b47d9fb17e
10 changed files with 496 additions and 546 deletions

View File

@@ -14,7 +14,7 @@ const getParseClassQueryConfig = function(
};
const getQuery = async (className, _source, args, context, queryInfo) => {
const { objectId, readPreference, includeReadPreference } = args;
const { id, readPreference, includeReadPreference } = args;
const { config, auth, info } = context;
const selectedFields = getFieldNames(queryInfo);
@@ -22,7 +22,7 @@ const getQuery = async (className, _source, args, context, queryInfo) => {
return await objectsQueries.getObject(
className,
objectId,
id,
keys,
include,
readPreference,
@@ -57,7 +57,7 @@ const load = function(
parseGraphQLSchema.addGraphQLQuery(getGraphQLQueryName, {
description: `The ${getGraphQLQueryName} query can be used to get an object of the ${graphQLClassName} class by its id.`,
args: {
objectId: defaultGraphQLTypes.OBJECT_ID_ATT,
id: defaultGraphQLTypes.OBJECT_ID_ATT,
readPreference: defaultGraphQLTypes.READ_PREFERENCE_ATT,
includeReadPreference: defaultGraphQLTypes.INCLUDE_READ_PREFERENCE_ATT,
},