-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
refactor(GraphQL): Rename objectId to id #5985
refactor(GraphQL): Rename objectId to id #5985
Conversation
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.
Currently object.id = object.objectId
delete object.objectId I think this is not a good solution, we will have many problems in the future. Here to main goal is only to map It will be much easier to maintain and easy to use for future features. Example: not tested
const CREATE_RESULT_FIELDS = {
id: OBJECT_ID_ATT,
createdAt: CREATED_AT_ATT,
};
const type = mapOutputType(
parseClass.fields[field].type,
parseClass.fields[field].targetClass,
parseGraphQLSchema.parseClassTypes
);
if(field === "objectId"){
return {
...fields,
'id': {
description: 'The ID (same as the old Parse objectId)',
type: new GraphQLNonNull(GraphQLID),
resolve: (parent) => parent.objectId
},
};
}
... @davimacedo what do you think ? |
Codecov Report
@@ Coverage Diff @@
## master #5985 +/- ##
==========================================
+ Coverage 93.69% 93.75% +0.06%
==========================================
Files 156 156
Lines 10926 10939 +13
==========================================
+ Hits 10237 10256 +19
+ Misses 689 683 -6
Continue to review full report at Codecov.
|
@Moumouls I've undone the @davimacedo any thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good. I have just one additional question.
* 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
Renames
objectId
toid
for the GraphQL API. Queries, mutations, custom and generic types were updated.Removes
RELATION_INPUT
andPOINTER_INPUT
. Now the user just needs to provide the ID of the object to link.