How can I get previous and next post in Strapi?

Thank you for reply @andreasoikon ,

Very good question :slight_smile: Also didn’t mention for GraphQL. Sorry for that. I was using WPGraphQL and Wordpress has get_adjacent_post() it returns previous or next post. I made a small plugin for that.
https://raw.githubusercontent.com/ozcancelik/wpgraphql-prev-next-random-post/main/wpgraphql-prev-next-random-post.php

I was using this feature as if it were a native feature. Just want to fetch another post based on the publishedAt and also need based on locale because I am using multiple languages.

My current query is :

export const GET_SINGLE_POST = gql`
  query getSinglePost($locale: I18NLocaleCode, $slug: String) {
    posts(locale: $locale, filters: { Slug: { eq: $slug } }) {
      data {
        attributes {
          Title
          Slug
          BlogContent
          publishedAt
          FeaturedImage {
            data {
              attributes {
                url
              }
            }
          }
          localizations {
            data {
              attributes {
                Title
                Slug
                Content
                FeaturedImage {
                  data {
                    attributes {
                      url
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
`;

Thank you again and sorry for missing information.