Skip to content

Commit

Permalink
definition: replace object spread with explicit assignments
Browse files Browse the repository at this point in the history
In preparation for graphql#1527
  • Loading branch information
IvanGoncharov committed Aug 14, 2019
1 parent b113ef7 commit e62033f
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/type/definition.js
Expand Up @@ -778,10 +778,15 @@ function defineFieldMap<TSource, TContext>(
}));

return {
...fieldConfig,
isDeprecated: Boolean(fieldConfig.deprecationReason),
name: fieldName,
description: fieldConfig.description,
type: fieldConfig.type,
args,
resolve: fieldConfig.resolve,
subscribe: fieldConfig.subscribe,
isDeprecated: Boolean(fieldConfig.deprecationReason),
deprecationReason: fieldConfig.deprecationReason,
astNode: fieldConfig.astNode,
};
});
}
Expand Down Expand Up @@ -1368,7 +1373,13 @@ function defineInputFieldMap(
`${config.name}.${fieldName} field has a resolve property, but Input Types cannot define resolvers.`,
);

return { ...fieldConfig, name: fieldName };
return {
name: fieldName,
type: fieldConfig.type,
defaultValue: fieldConfig.defaultValue,
description: fieldConfig.description,
astNode: fieldConfig.astNode,
};
});
}

Expand Down

0 comments on commit e62033f

Please sign in to comment.