GRAPHQL Queries

Constructing GraphQL query client configurations and mutation payloads in Python. Use when this capability is needed.

tomevault-io 722de04 2 files · 1.8 KB Updated

File contents

Graphql Queries

Overview

GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data.

When to Use This Skill

Use to interface with APIs that expose GraphQL endpoints (e.g., GitHub GraphQL API v4).

Quick Start (with runnable code examples)

import requests

url = 'https://api.github.com/graphql'
headers = {'Authorization': 'token ghp_...'}

query = """
query {
  viewer {
    login
    bio
  }
}
"""

r = requests.post(url, json={'query': query}, headers=headers)
print(r.json())

Advanced Usage

Handle GraphQL input variables, define fragment structures, configure mutations, and parse paginated cursor queries.

Key References

Dependencies

  • requests>=2.28.0

Source: Lord1Egypt/ai-skillforge — distributed by TomeVault.

tomevault-io/skills-registry/tree/main/lord1egypt--ai-skillforge--graphql-queries commit 722de047f1

Frequently asked questions

npx skillmds@latest add tomevault-io/graphql-queries