Almost EVERYONE who tried headless systems said they saw benefits. Download the state of CMS now!

Storyblok now on AWS Marketplace: Read more

O’Reilly Report: Decoupled Applications and Composable Web Architectures - Download Now

Empower your teams & get a 582% ROI: See Storyblok's CMS in action

Skip to main content
  • Section titled Graphql default order change Graphql default order change

    Changes in: gapi

    Attention: Storyblok's GraphQL api will have a behavior change that will be published at 19.04.2022 to fix a bug of the sorting option of the Multi-Option field.

    What will change?

    Currently the content items inside a multi-option field are sorted by the position they are defined in the content browser.

    {
      NavigationbarItems {
        items {
          name
          content {
            desktop_navigation_items {
              name
              uuid
            }
          }
        }
      }
    }
    

    In this query example the items inside "desktop_navigation_items" (Multi-options field) are sorted by the order they are visible in the content browser. But the multi-option field has a sorting function in the interface to let the user define a custom position. This custom position is currently not respected by the GraphQL api which is considered as a bug.

    Sorting

    After the change this custom position will be used to deliver the content items as the user defined it in the interface.

    To bring back the old behavior and sort the items as they are in the content browser you can use the new parameter sort_by=default.

    {
      NavigationbarItems {
        items {
          name
          content {
            desktop_navigation_items(sort_by: "default") {
              name
              uuid
            }
          }
        }
      }
    }