Querying content types that share many-to-many relations do not return expected results.
Let's say we have a product content type and a category centent type. those two models share many-to-many relation, and when we are querying categories we have the expected result, Ex :
Query :
{
categories {
Name
products {
Name
}
}
}
Result :
{
"data": {
"categories": [
{
"Name": "Category 1",
"products": [
{
"Name": "Product 1"
}
]
},
{
"Name": "Category 2",
"products": [
{
"Name": "Product 1"
}
]
}
]
}
}
But when we're querying products, the categories array is empty!!
Query:
{
products {
Name
categories {
Name
}
}
}
Result:
{
"data": {
"products": [
{
"Name": "Product 1",
"categories": [ ]
}
]
}
}
categories should not be empty, it should be something like that :
...
"categories": [
{
"Name": "Category 1"
},
{
"Name": "Category 2"
}
]
....
I hope that was clear.
Previously schema files could only end in .graphql files. This caused a problem with IDE's since these files are actually javascript files. This pull request should also detect ```.graphql.js``` files while keeping backward compatibility with the ```.graphql``` extension.
When there's an array of ID's present it looks like the Content Manager uses the '=' comparison which ends up returning an empty set. I think maybe the issue lies with the Content Manager plugin in that it should be using a 'IN' comparison if it detects an array. This is a workaround that seems to fix the issue. Although I'll be honest, I don't have enough knowledge of this plugin or the system to know if this will work for all edge cases.