What I'm trying to do is modify frontend in magento2 using reactjs to make it more faster to implements and faster response with actions on the website. But first thing I must to do is retreving data from magento2 api using graphql, then make it render in reactjs, cuz the frontend will be connecting to backend by graphql. The problem is, magento2 api have 1 object that has fields with the same key name but diffrent types, this is the custom_attributes
- the key name value
has 1 field with list of string and the rest is just string. I have already tried to use union and interface while building schema for api in graphql, but it always give me an error that my schema cannot provide interfaces, nor unions. Maybe someone was using magento2 api with graphql and give me some advice?
Btw. I heared about schema.org that can integrate with reactjs and graphql as well but I didnt saw good enough tutorials that shows how to connect them all.
To be precise, fragment from api looks like that:
{
custom_attributes: [
{
attribute_code: some string
value: some string
}
{
attribute_code: some string
value: [
some string,
some string,
some string
]
}
]
}