Run Prettier JS #2 (#6796)

This commit is contained in:
Diamond Lewis
2020-07-13 17:13:08 -05:00
committed by GitHub
parent e6a6354b29
commit 142eaa71bd
40 changed files with 323 additions and 330 deletions

View File

@@ -22,13 +22,13 @@ export function toGraphQLError(error) {
return new ApolloError(message, code);
}
export const extractKeysAndInclude = (selectedFields) => {
export const extractKeysAndInclude = selectedFields => {
selectedFields = selectedFields.filter(
(field) => !field.includes('__typename')
field => !field.includes('__typename')
);
// Handles "id" field for both current and included objects
selectedFields = selectedFields.map((field) => {
selectedFields = selectedFields.map(field => {
if (field === 'id') return 'objectId';
return field.endsWith('.id')
? `${field.substring(0, field.lastIndexOf('.id'))}.objectId`