Skip to content

Conversation

@koistya
Copy link
Member

@koistya koistya commented Aug 20, 2020

This is a demo implementation of user stories and comments. For example, a single story can be fetched by a slug value:

https://example.com/hello-world-abc123

query {
  story(slug: "hello-world-abc123") {
    id
    slug
    title
    text(truncate: 100)
    isURL
    pointsCount
    pointsGiven
    createdAt(format: "LL")

    # Author of the story
    author {
      id
      name
      picture
    }

    # Comments linked to the story
    comments(first: 20) {
      edges {
        node {
          id
          text
          createdAt(format: "LL")
          author {
            name
            picture
          }
        }
      }
    }
  }
}
# Create or update a story

mutation {
  upsertStory(input: { title: "...", text: "..." }) {
    story { .... }
  }
}
# Give it a like

mutation {
  likeStory(input: { id: "..." }) {
    story { .... }
  }
}

@koistya koistya self-assigned this Aug 20, 2020
@koistya koistya changed the title Stories and comments User stories and comments (demo) Aug 20, 2020
@koistya koistya changed the base branch from master to main September 11, 2020 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant