-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Component: Framework/WebapiUSE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just CatalogUSE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just CatalogEvent: distributed-cdDistributed Contribution DayDistributed Contribution DayFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passed
Description
Every field of the ProductFilterInput input field in Magento_CatagolGraphQl::etc/graphql.xml has the type FilterTypeInput. The problem here is that FilterTypeInput requires most of its arguments to be strings.
For example, I might want to select products that do not have a special price set. This might be some query like:
{
products(filter: { special_price: { null: true } }) {
total_count
}
}The devdocs, and basic intuition seem to suggest this is okay. However, this doesn't work because Magento_GraphQl::etc/graphql.xml requires the null field in FilterTypeInput to be a string.
Preconditions
- This is GraphQL, so it's in
2.3-develop, natch.
Steps to reproduce
- Try to submit the query written above.
Expected result
Based on the documentation, I would expect this to be a legal query.
Receive a response like this:
{
"data": {
"products": {
"total_count": 0
}
}
}Actual result
Response:
{
"errors": [
{
"message": "Argument \"filter\" has invalid value {special_price: {null: true}}.\nIn field \"special_price\": In field \"null\": Expected type \"String\", found true.",
"category": "graphql",
"locations": [
{
"line": 2,
"column": 20
}
]
}
]
}This also applies to other fields. For example, I was unable to filter products by category ids.
Metadata
Metadata
Assignees
Labels
Component: Framework/WebapiUSE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just CatalogUSE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just CatalogEvent: distributed-cdDistributed Contribution DayDistributed Contribution DayFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passed