feat(fieldconfig): decorator is added#76
Conversation
| } | ||
|
|
||
| ret.push(fieldConfig); | ||
| // ret.push({ |
There was a problem hiding this comment.
delete comment or add TODO if it is useful for near future update
|
|
||
| const fieldConfigMetadataKey = Symbol('fieldconfigclass'); | ||
| type KeyValueDict = Record<string, unknown>; | ||
| const target = {}; |
There was a problem hiding this comment.
I should have thought about it earlier but since target is static and global it can be used to store the data directly without using reflect metadata.
it will make the code bit simpler to understand.
up to you if u want to change it, its ok either way by my standard (for this use case)
There was a problem hiding this comment.
Done, reflection is removed, more clean code
|
This pull request introduces 2 alerts when merging cbb9db1 into 2c885c4 - view on LGTM.com new alerts:
|
|
|
||
| const classDataList = getFieldConfigClassesInfo(); | ||
| classDataList.push(classData); | ||
| target.concat(classDataList); |
There was a problem hiding this comment.
concat doesn't update the target in js but returns new array
There was a problem hiding this comment.
Done, working directly with target
| const classDataList = getGraphQLClassMapping(); | ||
| classDataList.push(classData); | ||
| Reflect.defineMetadata(graphQLMetadataKey, classDataList, target); | ||
| target.concat(classDataList); |
There was a problem hiding this comment.
concat doesn't update the target in js but returns new array
There was a problem hiding this comment.
Done, working directly with target
New fieldConfig decorator is added