GraphQL API
Learn how to use our GraphQL API for flexible and efficient data querying.
1
Overview
Our GraphQL API provides a flexible way to query exactly the data you need.
Benefits of using our GraphQL API:
- Request exactly the data you need
- Reduce over-fetching and under-fetching
- Single endpoint for all operations
- Strong typing and schema validation
2
Authentication
All GraphQL requests require authentication using an API key.
Add your API key to the Authorization header:
Authorization Header
Bash
Authorization: Bearer your-api-key
API Authentication Example
3
Example Queries
Common GraphQL queries and mutations.
Fetch Stories
stories-query.graphql
GraphQL
query {
stories {
id
title
content
createdAt
repository {
name
url
}
}
}
GraphQL query to fetch all stories
Generate Story
generate-story-mutation.graphql
GraphQL
mutation {
generateStory(input: {
repositoryUrl: "https://github.com/user/repo"
templateId: "template-id"
}) {
id
title
content
}
}
GraphQL mutation to generate a new story
4
Schema
Explore our self-documenting GraphQL schema.
Story
Represents a generated story
idtitlecontentcreatedAtrepository
Repository
Information about a Git repository
idnameurldefaultBranchstories
Template
Story generation templates
idnamedescriptionformatvariables
User
User account information
idemailnamerepositoriesstories