datocms / gatsby-source-datocms

Official GatsbyJS source plugin to pull content from DatoCMS
MIT License
140 stars 50 forks source link

I can't seem to figure out how to order items by position #88

Closed anderskitson closed 4 years ago

anderskitson commented 4 years ago

In the dato API Explorer I can order posts by position like so

query MyQuery {
  allProjects(orderBy: position_ASC) {
    slug
  }
}

However in Gatsby the same query alludes me I have tried something like this below but it gives me this error Expected type SortOrderEnum, found position_ASC

query MyQuery {
  allDatoCmsProject(sort: {order: position_ASC}) {
    edges {
      node {
        slug
      }
    }
  }
}
wispyco commented 4 years ago

I have a more detailed question on stackoverflow https://stackoverflow.com/questions/59603233/attempting-to-sort-graphql-order-by-position-with-datocms-adn-gatsby-js

stefanoverna commented 4 years ago

Replied on SO!