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:
committed by
Antonio Davi Macedo Coelho de Castro
parent
194f548464
commit
b47d9fb17e
@@ -17,9 +17,17 @@ export const extractKeysAndInclude = selectedFields => {
|
||||
selectedFields = selectedFields.filter(
|
||||
field => !field.includes('__typename')
|
||||
);
|
||||
|
||||
// Handles "id" field for both current and included objects
|
||||
selectedFields = selectedFields.map(field => {
|
||||
if (field === 'id') return 'objectId';
|
||||
return field.endsWith('.id')
|
||||
? `${field.substring(0, field.lastIndexOf('.id'))}.objectId`
|
||||
: field;
|
||||
});
|
||||
let keys = undefined;
|
||||
let include = undefined;
|
||||
if (selectedFields && selectedFields.length > 0) {
|
||||
if (selectedFields.length > 0) {
|
||||
keys = selectedFields.join(',');
|
||||
include = selectedFields
|
||||
.reduce((fields, field) => {
|
||||
|
||||
Reference in New Issue
Block a user