graphitation
graphitation copied to clipboard
Fix to add default value as object to argumentDefinitions
The problem is described in #401. For short, we weren't able to add a defaultValue to argumentDefinitions directive as an object. The root cause is that, when the metadata is created in extractMetadataTransform.ts
, it maps each parameter (key) to the generated object from graphqlAST (value). The value is created using valueFromASTUntyped. When the value is KIND.OBJECT
(like our case), it'll call keyValMap. The result is created as a pure Object (using Object.create(null)
), and it doesn't have hasOwnProperty
, which is needed internally by relay-compiler, as you can see in the following screenshot:
TODO:
- Update tests