Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User stories and comments (demo) #242

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

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